You are in charge of security at a top-secret government research facility. Your government has captured a live extra-terrestrial (ET) and is hosting an open day for visiting researchers. Not every guest can be trusted, so each is assigned a security clearance level. Only guests with a level-5 rating may enter the room holding the ET; everyone else is free to roam the rest of the facility.
Each room is connected to others by one-way airlocks: a door can be passed through in only one direction. Every guest enters the facility through room 0.
To protect the ET you will post armed guards in exactly one room on the route to it — but not in the ET's room itself, because the guards lack the clearance to enter it. The guards inspect the identity and clearance of every guest who passes through their room, so you want to place them where they inconvenience the fewest guests who have no intention of visiting the ET. The room where the guards are posted must therefore satisfy both of the following conditions:
Determine the room in which to post the guards.
The first line contains two integers $R$ and $t$: the number of rooms and the room holding the ET. Rooms are numbered from $0$ to $R-1$, and every guest enters through room $0$.
Each of the remaining lines contains two integers $a$ and $b$, describing a one-way airlock leading from room $a$ to room $b$ (you may pass only from $a$ to $b$). The list of doors continues until the end of the input.
Print a single line:
Put guards in room N.
where $N$ is the room you have chosen for the guards.
The diagram below illustrates the sample facility.
