{"raw_statement":[{"iden":"problem statement","content":"We have a string $S$ of length $2N$.  \nYou are given $Q$ queries on this string.  \nIn the $i$\\-th query, given three integers $T_i$, $A_i$, and $B_i$, do the following:\n\n*   if $T_i = 1$: swap the $A_i$\\-th and $B_i$\\-th characters of $S$;\n*   if $T_i = 2$: swap the first $N$ characters and last $N$ characters of $S$ (the values $A_i$ and $B_i$ are not used).  \n    For example, if $S$ is `FLIP`, this query makes it `IPFL`.\n\nPrint the string $S$ after processing all $Q$ queries in the order they are given."},{"iden":"constraints","content":"*   $1 \\le N \\le 2 \\times 10^5$\n*   $S$ is a string of length $2N$ consisting of uppercase English letters.\n*   $1 \\le Q \\le 3 \\times 10^5$\n*   $T_i$ is $1$ or $2$.\n*   If $T_i = 1$, $1 \\le A_i \\lt B_i \\le 2N$.\n*   If $T_i = 2$, $A_i = B_i = 0$."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$S$\n$Q$\n$T_1$ $A_1$ $B_1$\n$T_2$ $A_2$ $B_2$\n$T_3$ $A_3$ $B_3$\n$\\hspace{21pt} \\vdots$\n$T_Q$ $A_Q$ $B_Q$"},{"iden":"sample input 1","content":"2\nFLIP\n2\n2 0 0\n1 1 4"},{"iden":"sample output 1","content":"LPFI\n\nThe $1$\\-st query swaps the first $N$ characters and last $N$ characters of $S$, making it `IPFL`.  \nThe $2$\\-nd query swaps the $1$\\-st and $4$\\-th characters of $S$, making it `LPFI`."},{"iden":"sample input 2","content":"2\nFLIP\n6\n1 1 3\n2 0 0\n1 1 2\n1 2 3\n2 0 0\n1 1 4"},{"iden":"sample output 2","content":"ILPF"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}