Swimming pool#9543

Swimming pool

1 second
64 megabytes
Medium

In indoor swimming competitions, stronger swimmers are typically placed in the center lanes for better visual perception, while weaker swimmers are placed in the outer lanes. For example, in a pool with lanes, the best swimmer is assigned to lane , the second-best to lane , the third to lane , the fourth to lane , the fifth to lane , and the sixth to lane . Additionally, every effort is made to fill all lanes in every heat, ensuring that at least half of the pool's lanes are occupied. Athletes prefer to compete against stronger opponents, so they are not placed in weaker heats unless necessary.

We consider a pool with lanes. You are given preliminary results for a certain distance: a list of athlete surnames and their results (a string and a real number). Your task is to create a system that, given a surname and the preliminary results, determines the heat number and lane number for that athlete.

Input

The first line contains the integer (3 \le K \le 50), the number of athletes. Each of the next lines contains an athlete's surname and their preliminary result (a string and a real number). There are no duplicate surnames or results. The last line contains the surname of the athlete for whom you are to determine the heat and lane numbers.

Output

Output two integers: the heat number and the lane number, separated by a space. If the athlete is not found in the heats, output Missing.

Examples

Example 1

Loading
Loading

Note

For example:The first heat: lane – sidorov, lane – koss, lane – bas, lane – kolos, lane – tkachov, lane – sych.The second heat: lane – free, lane – oskol, lane – lol, lane – ivanov, lane – petrov, lane – free.