Limits 1s, 512 MB

Your friend is participating in the "Take-off Programming Contest Spring 2023". This time, he wants to win it. So he doesn’t have any time to waste. Today, he selects some problems to practice. He will gain PP units of energy for each correct submission, and for each incorrect submission, he will lose PP units of energy. As he is a human being, his energy cannot be negative i.e. energy should always be greater or equal to 00.

Sometimes he needs to know the current amount of energy he has. As he has no time to lose, he asked for your help to make a program to make this calculation.

Input

The first line will be a single integer TT denoting the number of test cases.

In each test case, the first line will be an integer number QQ indicating the number of queries. The following QQ lines will be a query of 33 types —

11 PP : 11 means his solution is correct, and he will get PP units of energy.

22 PP : 22 means his solution is Incorrect, and PP units of energy will be deducted.

33 : 33 means the program has to print the current units of energy he has.

1T,Q1031 \le T, Q \le 10^3

1P21474836471\le P \le 2147483647

The energy he has will always be greater than or equal to 00 (This means if the summation of energy is Less than 00 then the program will save the current points as 00)

Output

For each test case, output a line in the format “Case X:” (without quotes) where X(1XT)X (1 \le X \le T) is the number of test case.

In the next lines for each query of type 33, you have to print a line “Y units of energy“ where YY is the result of the query.

After each test case, an additional new line should be printed. Check out the samples for clarification.

Samples

InputOutput
2

5
1 100
3 
2 50
1 100
3

3
2 200
1 100
2 50
Case 1:
100 units of energy
150 units of energy

Case 2:

In the test case 2 there was no type 3 query so the case won’t have to print anything but it will print the new line as usual, keep that in mind.

InputOutput
2

5
2 100
3 
2 50
1 100
3

3
2 200
1 100
3 50
Case 1:
0 units of energy
100 units of energy

Case 2:
100 units of energy


Be careful about the new line(‘\n’) at the end.

Submit

Login to submit.

Statistics

19% Solution Ratio
Asif_AlimEarliest, 10M ago
TarequeFastest, 0.2s
tanvir4nLightest, 4.9 MB
user.8680Shortest, 507B
Toph uses cookies. By continuing you agree to our Cookie Policy.