{"raw_statement":[{"iden":"problem statement","content":"You have decided to write a book introducing good restaurants. There are $N$ restaurants that you want to introduce: Restaurant $1$, Restaurant $2$, $...$, Restaurant $N$. Restaurant $i$ is in city $S_i$, and your assessment score of that restaurant on a $100$\\-point scale is $P_i$. No two restaurants have the same score.\nYou want to introduce the restaurants in the following order:\n\n*   The restaurants are arranged in lexicographical order of the names of their cities.\n*   If there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book."},{"iden":"constraints","content":"*   $1 ≤ N ≤ 100$\n*   $S$ is a string of length between $1$ and $10$ (inclusive) consisting of lowercase English letters.\n*   $0 ≤ P_i ≤ 100$\n*   $P_i$ is an integer.\n*   $P_i ≠ P_j$ $(1 ≤ i < j ≤ N)$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$S_1$ $P_1$\n$:$\n$S_N$ $P_N$"},{"iden":"sample input 1","content":"6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40"},{"iden":"sample output 1","content":"3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is `kazan` $<$ `khabarovsk` $<$ `moscow`. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order $3,4,6,1,5,2$."},{"iden":"sample input 2","content":"10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100"},{"iden":"sample output 2","content":"10\n9\n8\n7\n6\n5\n4\n3\n2\n1"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}