Let there be two arrays of real numbers: X = (x_0, x_1, \ldots, x_{n-1}) and Y = (y_0, y_1, \ldots, y_{n-1}). Each array contains exactly 2^{30} elements (meaning n = 2^{30}). Let us denote z_k = x_k + iy_k, k = 0, 1, \ldots, 2^{30}-1. The discrete Fourier transform has already been performed for z_k and it is known that
Let A = \text{DFT}_n(X), B = \text{DFT}_n(Y). Your task is to determine A_k and B_k for a given index .
The first line of input contains integers , , , (1 \leq A, B, C, D \leq 1000). The second line contains an integer (1 \leq q \leq 10^5). The next line contains space-separated integers — the indices for which A_k and B_k need to be calculated (each index is at least and at most 2^{30}-1).
Output exactly lines. In each of the lines, output four numbers: \text{real}(A_k), \text{imag}(A_k), \text{real}(B_k), \text{imag}(B_k). Separate numbers in a line with spaces. Separate answers for different indices with line breaks. Output numbers with relative or absolute error not exceeding 10^{-6}.
Example 1