There are multiple test cases. The first line of input contains an integer(
), the number of test cases. For each test case:
The first line contains an integerand
(
,
) - the length of the permutations and the number of operations.
Each of the followinglines contains one string
and two integers
and
representing an operation.
is one of ”swap_a”, ”swap_p” and ”cmp”. If
is one of ”swap_a” and ”swap_p”,
,
. If
is ”cmp”,
,
.
It is guaranteed that the sum ofand the sum of
over all tests do not exceed
.
For each test case:For each query, output ”<” ifis lexicographically smaller than
; output ”>” if
is lexicographically greater than
(i.e.,
is lexicographically smaller than
); output ”=” if
.