[Login|Register]
Problems

Status

Rank

Problem 1139
Interval
Time Limit: 1000ms
Memory Limit: 65536kb
Description
There 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:

Input
We 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" .
Output
The 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.
Sample Input
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
Sample Output
(2,3) [4,6)
empty set
University of Science and Technology of China
Online Judge for ACM/ICPC
Processed in 0.8ms with 1 query(s).