Score : $300$ points
We have a string $S$ of length $2N$.
You are given $Q$ queries on this string.
In the $i$-th query, given three integers $T_i$, $A_i$, and $B_i$, do the following:
FLIP
, this query makes it IPFL
.Print the string $S$ after processing all $Q$ queries in the order they are given.
Input is given from Standard Input in the following format:
$N$ $S$ $Q$ $T_1$ $A_1$ $B_1$ $T_2$ $A_2$ $B_2$ $T_3$ $A_3$ $B_3$ $\hspace{21pt} \vdots$ $T_Q$ $A_Q$ $B_Q$
Print the string $S$ after processing the queries.
2 FLIP 2 2 0 0 1 1 4
LPFI
The $1$-st query swaps the first $N$ characters and last $N$ characters of $S$, making it IPFL
.
The $2$-nd query swaps the $1$-st and $4$-th characters of $S$, making it LPFI
.
2 FLIP 6 1 1 3 2 0 0 1 1 2 1 2 3 2 0 0 1 1 4
ILPF