{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eThis is an interactive problem.\u003c/span\u003e\u003c/p\u003e\u003cp\u003eWhen preparing to New Year Eve, Queen Amidala always checks her electric garland to ensure it works. The garland consist of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e lamps which are numbered from \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e; there are \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003en\u003c/i\u003e - 1)\u003c/span\u003e pairs of them which are allowed to be connected with wires to form a special structure. Each wire in the structure connects exactly two different lamps, and all the lamps are connected together with the wires.\u003c/p\u003e\u003cp\u003eHowever, the garland is so huge that this year, the Queen decided not to build the whole structure at once. However, she still needs to check each wire. So, she will connect some of the wires, then check if electric current can pass from some lamps to some others, then disconnect some of the connected wires, connect other ones and so on. More formally, the Queen will perform a sequence of operations. Each operation will be one of the following: \u003c/p\u003e\u003cul\u003e \u003cli\u003e Connect two different lamps with a wire; \u003c/li\u003e\u003cli\u003e Remove a wire that connects two lamps; \u003c/li\u003e\u003cli\u003e Test if electric current can pass between two lamps by the wires that are currently connected. \u003c/li\u003e\u003c/ul\u003e In order to properly test the garland, she will always follow the garland structure. This means that she will only connect pairs of lamps which are allowed to be connected. Moreover, Amidala will connect and disconnect any of the \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003en\u003c/i\u003e - 1)\u003c/span\u003e allowed pairs exactly once.\u003cp\u003eThe Queen was almost starting to check the garland, but she realized that not all her tests will be meaningful because some pairs of lamps will be disconnected at the time she checks them, and the current will not pass even if the garland is in fact working. She asked Anakin Skywalker to help in checking her plan of checking the garland. Anakin is sure that it\u0027s boring to proceed all the operations manually, so he asked you to write a program which will process all three types of operations described above; for each test operation, the program must answer whether the two lamps are connected by wires of not. Anakin shouldn\u0027t disgrace himself in Amidala\u0027s eyes, so don\u0027t let him down!\u003c/p\u003e"}},{"title":"Interaction","value":{"format":"HTML","content":"\u003cp\u003eAt start, your program will be given an integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 100 000\u003c/span\u003e). After that, you have to process queries one by one. Each query will be entered on a separate line in one of the following forms: \u003c/p\u003e\u003cul\u003e \u003cli\u003e \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u0026nbsp;\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e\u0026nbsp;\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e\u003c/span\u003e\", where \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e are integers (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003ea\u003c/i\u003e, \u003ci\u003eb\u003c/i\u003e ≤ \u003ci\u003en\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e ≠ \u003ci\u003eb\u003c/i\u003e\u003c/span\u003e). This query means that the Queen is connecting lamps \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e with a wire. There will be exactly \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003en\u003c/i\u003e - 1)\u003c/span\u003e such queries. \u003c/li\u003e\u003cli\u003e \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eD\u0026nbsp;\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e\u0026nbsp;\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e\u003c/span\u003e\", where \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e are integers (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003ea\u003c/i\u003e, \u003ci\u003eb\u003c/i\u003e ≤ \u003ci\u003en\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e ≠ \u003ci\u003eb\u003c/i\u003e\u003c/span\u003e). This query means that the Queen is disconnecting lamps \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e. It\u0027s guaranteed that at the moment this query is entered, lamps \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e are connected by a wire; note that pairs \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003ea\u003c/i\u003e, \u003ci\u003eb\u003c/i\u003e)\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003eb\u003c/i\u003e, \u003ci\u003ea\u003c/i\u003e)\u003c/span\u003e correspond to the same wire. There will be exactly \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003en\u003c/i\u003e - 1)\u003c/span\u003e such queries. \u003c/li\u003e\u003cli\u003e \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eT\u0026nbsp;\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e\u0026nbsp;\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e\u003c/span\u003e\", where \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e are integers (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003ea\u003c/i\u003e, \u003ci\u003eb\u003c/i\u003e ≤ \u003ci\u003en\u003c/i\u003e\u003c/span\u003e). This query means that the Queen is testing if electric current can pass between lamps \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e. You must print a line containing \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\" (without quotes) if lamps \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e are reachable from each other by wires, and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\" otherwise. Do not forget to flush your output. \u003c/li\u003e\u003cli\u003e \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eE\u003c/span\u003e\", this means the end of checking, your program must immediately terminate after receiving this query. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThere will be no more than \u003cspan class\u003d\"tex-span\"\u003e300 000\u003c/span\u003e queries.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the queries will always follow the garland\u0027s structure, and each possible wire will be connected and disconnected exactly once.\u003c/p\u003e\u003cp\u003eInitially, all possible wires are disconnected.\u003c/p\u003e"}},{"title":"Examples","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\u003e3\nC 1 2\nC 2 3\nT 1 2\n\n\u0026nbsp;\n\nD 2 3\nD 1 2\nT 1 2\n\n\u0026nbsp;\n\nE\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u0026nbsp;\n\n\n\u0026nbsp;\n\n\n\u0026nbsp;\n\n\n\u0026nbsp;\n\nYES\n\n\u0026nbsp;\n\n\n\u0026nbsp;\n\n\n\u0026nbsp;\n\nNO\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}