Solve the programming task below in a Python markdown code block.
Example

Input

4
Durett 7
Gayles 3
Facenda 6
Daughtery 0
1
+ Mccourtney 2


Output

Mccourtney is not working now.
Durett is working hard now.