The first line contains one integer T (1 ≤ T ≤ 5) denoting the count of testcase.
For each testcase,
The first line contains integers n,$k_1$,$k_2$ (1 ≤ n ≤ $10^6$,0 ≤ $k_1$,$k_2$ ≤ $2^{64}$ -1), which is used in function gen().
The second line contains integer Q (1 ≤ Q ≤ $5\cdot 10^5$).
Then follow Q lines, each containing one command op x (op ∈{F,D,C,R},1 ≤ x ≤ $10^{12}$ -1).
It is guaranteed that the count of type R does not exceed 10, and $a_i \neq a_j$ holds for each pair of (i,j) where i $\neq$ j.
It is guaranteed that $\sum$n ≤ $3.2\times 10^6$ and $Q ≤ 1.7\times 10^6$.