Time Limit: 1000ms
Memory Limit: 65536kb
DescriptionThere are five kinds of operation mode to implement on the set S (S is empty initially). You are supposed to give us the final S after several operations.
The five kinds of operation are presented as below:
Note: T is another set . The definitions of basic set operations are presented as below:
InputWe offer you several data sets. Every data set contains M+1 lines.
The first M lines are in the form of "X T". As you see, there is a space between X and T . X denotes the kind of operation, and T is an interval showed like (a,b), (a,b], [a,b), [a,b] .
the last line is "END" .
OutputThe answer to every data set in the input file should take up one line, which is S .If S contains more than one intervals , there should be separated by spaces . Unfortunately, if S is empty, please show us "empty set" in this line.
U [1,5] D [3,3] S [2,4] C (1,5) I (2,3] U [4,6) END S [3,5] S [3,5] END
(2,3) [4,6) empty set