The first number in the input line, t (1 <= t <= 10) is the number of orders. Following this, t orders are written in the input. Each order starts with a line containing a street name, an arbitrary string of length at most 50 characters. The second line contains a single integer N (1 <= N <= 10), the number of sub-orders, followed by N lines of sub-orders. Sub-orders are of three kinds:
- A single house number: in this case, the sub-order line contains only a single integer n (1 <= n <= 9999)
- A series of house numbers: in this case, the sub-order line starts with a '+', followed by three integer numbers a, b, c (1 <= a, b, c <= 9999). This means that NarmakSung has to make plates for house numbers from a up to b with distance of c. That is, digit plates have to be made for house numbers a, a+c, a+2c, ..., b. We assume that a < b, b - a is a multiple of c, and c <= b - a.
- A series of house numbers to be excluded: this kind of sub-orders specifies that a series of house numbers should not be made. In this case, the sub-order line starts with a '-', followed by three integer numbers with exactly the same conditions as in the previous case.
Note that if a house number is ordered more than once in two separate sub-orders, it is counted only once if it is not excluded at all (like number 100 in the second test case in the sample input). Also, if a house number is excluded somewhere in the test case, it cancels any order for that number, even if it appears later in the test case (like number 500 in the second sample). Note that it is possible to exclude some numbers that do not appear in other orders at all. In this case, these numbers are ignored (like 900 in the second sample).