NarmakSung has a hardware shop that makes new digit plates for house numbers. If a house number is , for example, he has to create one plate for digit , one for digit , and one for digit . But, the orders are not always that simple. He may get orders to make digit plates, for example, for all houses in one side of a street.
Since making several plates of the same digit costs much less than making all digits for each house one by one, he wants to know, for a big order he receives, how many of each digit plate he has to make.
The first number in the input line, (1 \le t \le 10) is the number of orders. Following this, orders are written in the input file. Each order starts with a line containing a street name, an arbitrary string of length at most characters. The second line contains a single integer (1 \le N \le 10), the number of sub-orders, followed by 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 (1 \le n \le 9999).
A series of house numbers: in this case, the sub-order line starts with a '+', followed by three integer numbers , , (1 \le a, b, c \le 9999). This means that NarmakSung has to make plates for house numbers from up to with distance of . That is, digit plates have to be made for house numbers , a+c, a+2c, ..., . We assume that a < b, b - a is a multiple of , and c \le 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 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 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 in the second sample).
One set of output data is written for each input order consisting of lines. Each set starts with one line containing the street name exactly as appeared in the input order. The next line must be of the form addresses where is the total number of house numbers to be made. In the special case of C = 1, the output line should be 1 address. The next lines should be of the following form: Line should contain the number of digit plates needed to be made for digit . These lines are on the format "Make X digit Y" where is how many copies of digit they need to make. The last line states the total number of digits needed, on the format "In total Z digits". If there is only one digit to produce, it should say, "In total 1 digit", in order to be grammatically correct. The output should be case-sensitive.
Example 1