Page not loading? Try clicking here.
Placeholder

#5527

Call Center 1s 64MB

Problems

Calling a call center is a series of long waits.

Therefore, Sujeong wants to develop a program that informs how many people are waiting and how many total minutes of waiting time are expected.

 

The program receives a total of three types of commands as follows.

- call X: A person expected to have an X-minute call is added to the waiting line.

- wait​ X: X minutes pass, and the number of people in the waiting line and the expected waiting time change as time passes.

- check: Outputs the number of waiting people and the expected waiting time in the format "A people B minutes".


Input

The number of commands N is given in the first line. (1 \le N \le 100)

From the second line, commands are given over N lines. There are three types of commands: "call X", "wait X", and "check". (1 \le X \le 100)


Output

Output in the form of "A people B minutes" on each line as many times as the number of check statements.


Example

8

call 6
call 3
check
wait 4
wait 4
check
call 2
check
2 people 9 minutes

1 people 1 minutes
2 people 3 minutes



Source

klee

You must sign in to write code.