{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eLogLoader, Inc. is a company specialized in providing products for analyzing logs. While Ikki is working on graduation design, he is also engaged in an internship at LogLoader. Among his tasks, one is to write a module for manipulating time intervals, which have confused him a lot. Now he badly needs your help.\u003c/p\u003e\u003cp\u003eIn discrete mathematics, you have studied several basic set operations, namely union, intersection, relative complementation and symmetric difference, which naturally apply to the specialization of sets as intervals.. For your quick reference they are summarized in the table below:\u003c/p\u003e\u003cblockquote\u003e\u003ctable border\u003d\"1\" style\u003d\"border-collapse: collapse\" bordercolor\u003d\"#000000\" id\u003d\"table1\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003cth\u003eOperation\u003c/th\u003e\u003cth\u003eNotation\u003c/th\u003e\u003cth\u003e\u003cp align\u003d\"left\"\u003eDefinition\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\"\u003eUnion\u003c/td\u003e\u003ctd align\u003d\"center\"\u003e\u003ci\u003eA\u003c/i\u003e ∪ \u003ci\u003eB\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e{\u003ci\u003ex\u003c/i\u003e : \u003ci\u003ex\u003c/i\u003e ∈ \u003ci\u003eA\u003c/i\u003e or \u003ci\u003ex\u003c/i\u003e ∈ \u003ci\u003eB\u003c/i\u003e}\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\"\u003eIntersection\u003c/td\u003e\u003ctd align\u003d\"center\"\u003e\u003ci\u003eA\u003c/i\u003e ∩ \u003ci\u003eB\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e{\u003ci\u003ex\u003c/i\u003e : \u003ci\u003ex\u003c/i\u003e ∈ \u003ci\u003eA\u003c/i\u003e and \u003ci\u003ex\u003c/i\u003e ∈ \u003ci\u003eB\u003c/i\u003e}\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\"\u003eRelative complementation\u003c/td\u003e\u003ctd align\u003d\"center\"\u003e\u003ci\u003eA\u003c/i\u003e − \u003ci\u003eB\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e{\u003ci\u003ex\u003c/i\u003e : \u003ci\u003ex\u003c/i\u003e ∈ \u003ci\u003eA\u003c/i\u003e but \u003cscript lang\u003d\"javascript\"\u003edocument.write(navigator.userAgent.indexOf(\"MSIE 6.0\")!\u003d-1?\"not \u003ci\u003ex\u003c/i\u003e \u0026isin;\":\"\u003ci\u003ex\u003c/i\u003e \u0026notin;\");\u003c/script\u003e\u003ci\u003e B\u003c/i\u003e}\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"right\"\u003eSymmetric difference\u003c/td\u003e\u003ctd align\u003d\"center\"\u003e\u003ci\u003eA\u003c/i\u003e ⊕ \u003ci\u003eB\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e(\u003ci\u003eA\u003c/i\u003e − \u003ci\u003eB\u003c/i\u003e) ∪ (\u003ci\u003eB\u003c/i\u003e − \u003ci\u003eA\u003c/i\u003e)\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/blockquote\u003e\u003cp\u003eIkki has abstracted the interval operations emerging from his job as a tiny programming language. He wants you to implement an interpreter for him. The language maintains a set \u003ci\u003eS\u003c/i\u003e, which starts out empty and is modified as specified by the following commands:\u003c/p\u003e\u003cblockquote\u003e\u003ctable border\u003d\"1\" style\u003d\"border-collapse: collapse\" bordercolor\u003d\"#000000\" id\u003d\"table2\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003cth\u003eCommand\u003c/th\u003e\u003cth\u003eSemantics\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\"\u003e\u003ccode\u003eU\u003c/code\u003e \u003ci\u003eT\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e\u003ci\u003eS\u003c/i\u003e ← \u003ci\u003eS\u003c/i\u003e ∪ \u003ci\u003eT\u003c/i\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\"\u003e\u003ccode\u003eI\u003c/code\u003e \u003ci\u003eT\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e\u003ci\u003eS\u003c/i\u003e ← \u003ci\u003eS\u003c/i\u003e ∩ \u003ci\u003eT\u003c/i\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\"\u003e\u003ccode\u003eD\u003c/code\u003e \u003ci\u003eT\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e\u003ci\u003eS\u003c/i\u003e ← \u003ci\u003eS\u003c/i\u003e − \u003ci\u003eT\u003c/i\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\"\u003e\u003ccode\u003eC\u003c/code\u003e \u003ci\u003eT\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e\u003ci\u003eS\u003c/i\u003e ← \u003ci\u003eT\u003c/i\u003e − \u003ci\u003eS\u003c/i\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\"\u003e\u003ccode\u003eS\u003c/code\u003e \u003ci\u003eT\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e\u003ci\u003eS\u003c/i\u003e ← \u003ci\u003eS\u003c/i\u003e ⊕ \u003ci\u003eT\u003c/i\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/blockquote\u003e\u003c/span\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eThe input contains exactly one test case, which consists of between 0 and 65,535 (inclusive) commands of the language. Each command occupies a single line and appears like\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ccode\u003eX\u003c/code\u003e \u003ci\u003eT\u003c/i\u003e\u003c/p\u003e\u003c/blockquote\u003e\u003cp\u003ewhere \u003ccode\u003eX\u003c/code\u003e is one of ‘\u003ccode\u003eU\u003c/code\u003e’, ‘\u003ccode\u003eI\u003c/code\u003e’, ‘\u003ccode\u003eD\u003c/code\u003e’, ‘\u003ccode\u003eC\u003c/code\u003e’ and ‘\u003ccode\u003eS\u003c/code\u003e’ and \u003ci\u003eT\u003c/i\u003e is an interval in one of the forms \u003ccode\u003e(\u003c/code\u003e\u003ci\u003ea\u003c/i\u003e\u003ccode\u003e,\u003c/code\u003e\u003ci\u003eb\u003c/i\u003e\u003ccode\u003e)\u003c/code\u003e, \u003ccode\u003e(\u003c/code\u003e\u003ci\u003ea\u003c/i\u003e\u003ccode\u003e,\u003c/code\u003e\u003ci\u003eb\u003c/i\u003e\u003ccode\u003e]\u003c/code\u003e, \u003ccode\u003e[\u003c/code\u003e\u003ci\u003ea\u003c/i\u003e\u003ccode\u003e,\u003c/code\u003e\u003ci\u003eb\u003c/i\u003e\u003ccode\u003e)\u003c/code\u003e and \u003ccode\u003e[\u003c/code\u003e\u003ci\u003ea\u003c/i\u003e\u003ccode\u003e,\u003c/code\u003e\u003ci\u003eb\u003c/i\u003e\u003ccode\u003e]\u003c/code\u003e (\u003ci\u003ea\u003c/i\u003e, \u003ci\u003eb\u003c/i\u003e ∈ \u003ci\u003e\u003cb\u003eZ\u003c/b\u003e\u003c/i\u003e, 0 ≤ \u003ci\u003ea\u003c/i\u003e ≤ \u003ci\u003eb\u003c/i\u003e ≤ 65,535), which take their usual meanings. The commands are executed in the order they appear in the input.\u003c/p\u003e\u003cp\u003eEnd of file (EOF) indicates the end of input.\u003c/p\u003e\u003c/span\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eOutput the set \u003ci\u003eS\u003c/i\u003e as it is after the last command is executed as the union of a minimal collection of disjoint intervals. The intervals should be printed on one line separated by single spaces and appear in increasing order of their endpoints. If \u003ci\u003eS\u003c/i\u003e is empty, just print “\u003ccode\u003eempty set\u003c/code\u003e” and nothing else.\u003c/p\u003e\u003c/span\u003e"}},{"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\u003eU [1,5]\r\nD [3,3]\r\nS [2,4]\r\nC (1,5)\r\nI (2,3]\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e(2,3)\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}