TA Penguin07 wants to play a game with N people. Initially, these N people are lined up and numbered from 1 to N.
TA Penguin07 will issue K commands, commands i is represented as a pair of integers (Ti, Ai, Bi), and is the following operation:
However, Penguin07 has poor eyesight and cannot clearly see who has been killed from the long line. So, after each command issued by Penguin07, you need to tell Penguin07 who was killed.
If the command is invalid (that person has already been killed or there is no one been killed), you should output "Penguin07 QQ" (with no quotes).
The first line contains two positive integers, N and K.
The following K lines, each line represents a command in the format of three integers: (Ti, Ai, Bi).
Remember to print a ‘\n’ at the end of the output.
Do not include any spaces at the end of line.
The test data for this problem is quite large, so if you're using C++ to solve it should include IO optimization in your program.
remember to replace endl with '\n'.
#include<iostream>
...
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
/* write your code here*/
}