Warm-up#1160

Warm-up

1 second
64 megabytes
Very easy

Find the pair of numbers according to the specified criteria.

Input

The input file first contains the number (1 \leq N \leq 100), followed by pairs of numbers. The first number in each pair is a natural number not exceeding . The second number in each pair is either or .

Output

You are required to find and output the number (index) of the pair in which the second number is and, among all such pairs, the one with the largest first number (if there are several such pairs, output the first one). If there are no pairs in which the second number is , output .

Examples

Example 1

Loading
Loading