AT_past20_b 電車の乗り換え

Description

Trains from AtCoder station have two destinations: Takahashi station and Aoki station. You are given information on $ N $ trains. The $ i $ -th train $ (1\leq i\leq N) $ is described by a pair $ (S _ i,T _ i) $ of a string and a positive integer. It means that the train for station $ S _ i $ arrives at AtCoder station $ T _ i $ minutes later, where $ S _ i $ is equal to either `Aoki` or `Takahashi`. You are going to take the train for Takahashi station that arrives earliest at AtCoder station. Which train are you taking?

Input Format

The input is given from Standard Input in the following format: > $ N $ $ S _ 1 $ $ T _ 1 $ $ S _ 2 $ $ T _ 2 $ $ \vdots $ $ S _ N $ $ T _ N $

Output Format

If he is taking the $ i $ -th train $ (1\leq i\leq N) $ , print the integer $ i $ .

Explanation/Hint

### Sample Explanation 1 Information on five trains arriving at AtCoder station is given. Three of them are for Takahashi station: the $ 2 $ -nd train arriving three minutes later, the $ 3 $ -rd train arriving five minutes later, and the $ 5 $ -th train arriving $ 15 $ minutes later. The $ 2 $ -nd train arrives earliest among them, so `2` should be printed. ### Sample Explanation 2 Note that the given arrival times may not be sorted. ### Constraints - $ 1\leq N\leq2\times10 ^ 5 $ - $ S _ i $ is equal to either `Aoki` or `Takahashi` $ (1\leq i\leq N) $ . - $ 1\leq T _ i\leq10 ^ 9\ (1\leq i\leq N) $ - If $ i\neq j $ , then $ T _ i\neq T _ j\ (1\leq i,j\leq N) $ . - There exists $ i $ with $ S _ i={} $ `Takahashi`. - $ N $ and $ T _ i\ (1\leq i\leq N) $ are all integers.