{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eThe circular roundabout of 2nd road is an important traffic junction in Nanjing University of Science and Technology. To celebrate the 60th anniversary, the school officer decides to build some lamps with digital shape surrounding the circular roundabout.\u003cbr\u003eThere are 2N lamps to build. Lamps have the shape of digits, ranging from 1 to 2N. Specially, lamps will be built as a whole which can’t be split into single numbers. For example, lamp 19 can’t be split into lamp 1 and lamp 9. Since the roundabout is circular, the last lamp is next to the first lamp. Unfortunately, due to the carelessness of the construction team, some lamps are placed in the wrong position. Since the construction team is now\u003cbr\u003eabsent after finishing their work, we could only correct the order of lamps by ourselves. After rearrangement, the lamp with the shape i (1 \u0026lt;\u003d i \u0026lt;\u003d 2N) is expected to be placed on the i-th position. In other words, the final permutation should be 1, 2, ... , 2N. Because of the large volume of the lamps, we have only two ways to adjust the order \u003cbr\u003e\u003cbr\u003e1) Reverse the consecutive 4 lamps starting from the position x, denotes as (1 x). For example:\u003cbr\u003e(1 4): 1 2 3 [4 5 6 7] 8 -\u0026gt; 1 2 3 [7 6 5 4] 8\u003cbr\u003eor\u003cbr\u003e(1 6): 1] 2 3 4 5 [6 7 8 -\u0026gt; 6] 2 3 4 5 [1 8 7\u003cbr\u003ewhere ‘[’ stands for the start position, and ‘]’ stands for the end position respectively.\u003cbr\u003e2) Shift all lamps to the left by x positions, denotes as (2 x). For example:\u003cbr\u003e(2 4): 1 2 3 4 5 6 7 8 -\u0026gt; 5 6 7 8 1 2 3 4\u003cbr\u003eor\u003cbr\u003e(2 7): 1 2 3 4 5 6 7 8 -\u0026gt; 8 1 2 3 4 5 6 7\u003cbr\u003e\u003cbr\u003eThe data guarantees the existence of a valid adjustment sequence. Also the case where all lamps are already placed correctly will not exist in the input.\u003cbr\u003e\u003cbr\u003eYour task is to generate a valid adjustment sequence that all lamps are put on the correct position.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are several test cases, please process till EOF.\u003cbr\u003eEach test case starts with a line containing one integers N(2 \u0026lt;\u003d N \u0026lt;\u003d 30). The next line contains 2N different integers, the i-th number A\u003csub\u003ei\u003c/sub\u003e denotes that the shape of the i-th lamp is A\u003csub\u003ei\u003c/sub\u003e(1 \u0026lt;\u003d A\u003csub\u003ei\u003c/sub\u003e \u0026lt;\u003d 2N)."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, the first line of the output should contain a single integer S \u0026lt;\u003d 400000, denoting the number of swap operations you need to perform.\u003cbr\u003eEach of the following S lines should consist of two integers. The first one may be 1 or 2, indicating the type of swap operations. For the first type, the second number is the start position of the operation, and for the second type, the second number is the positions you need to shift. In both cases, the second number should be ranged between 1 and 2N.\u003cbr\u003eIf there are multiple possible solutions satisfying the conditions above, any one will be accepted. Please don’t print extra empty lines, spaces and other irrelevant characters."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n6 5 4 3 2 1 8 7\r\n4\r\n4 5 1 2 3 6 7 8\r\n4\r\n7 8 4 3 2 1 5 6\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n1 2\r\n1 6\r\n2\r\n1 2\r\n1 1\r\n2\r\n1 3\r\n2 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}