VK Cup 2016 - Wild Card Round 2


A. Scheduler for Invokers
time limit per test: 30 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
1
500 2
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
-1 -1
0
-1
-1 -1
0
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
0 0 OK
-1 -1
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
0 1 OK
-1 -1
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
-1 -1
-1
1 0 RJ
-1 -1
Output
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
0 0
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
0 1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
1 0
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
1 1
-1 -1
----------------------------------------------------------------------------------------------------
