LogLoader, 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.In 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:*S*, which starts out empty and is modified as specified by the following commands:

Ikki 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

Operation Notation Definition Union A∪B{ x:x∈Aorx∈B}Intersection A∩B{ x:x∈Aandx∈B}Relative complementation A−B{ x:x∈AbutB}Symmetric difference A⊕B( A−B) ∪ (B−A)

Command Semantics `U`

TS←S∪T`I`

TS←S∩T`D`

TS←S−T`C`

TS←T−S`S`

TS←S⊕T

The 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*T* is an interval in one of the forms *a**b**a**b**a**b**a**b**a*, *b* ∈ **Z**, 0 ≤ *a* ≤ *b* ≤ 65,535), which take their usual meanings. The commands are executed in the order they appear in the input.End of file (EOF) indicates the end of input.

where`X`

T

`X`

is one of ‘`U`

’, ‘`I`

’, ‘`D`

’, ‘`C`

’ and ‘`S`

’ and `(`

`,`

`)`

, `(`

`,`

`]`

, `[`

`,`

`)`

and `[`

`,`

`]`

(Output the set *S* 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 *S* is empty, just print “

`empty set`

” and nothing else.提交代码