Generally, Vasya's father is a professor. He is not only skilled in mathematics but is also a very neat person. All the books on his shelves are arranged neatly, with each book containing a card inside. On this card is written the title of the book and notes about its interesting points (unlike many people, Vasya's father takes care of his books and does not write notes directly in them).
One day, while his father was not at home, Vasya invited a girl over. In order to prevent his younger brother and sister from interfering, he sent them to play in his father's study. The study remained suspiciously quiet the whole hour. When the girl left, Vasya went to check on the children and realized that if he wanted to have a peaceful evening, he needed to do something quickly. All the books and cards were scattered and mixed up on the floor. Vasya quickly gathered the books, put a card in each one, and placed them back on the shelves. He remembered the order of the books and arranged them correctly.
When his father came home, the books were placed neatly and correctly, but the cards did not match the books. To Vasya's dismay, his father decided to read a book after dinner. Upon discovering that the card did not correspond to the book, his father was surprised and asked Vasya what had happened. Vasya told the whole truth. Perhaps the dinner was tasty, or perhaps his father just remembered how he courted his mother as a student, but he did not punish the children. Instead, he came up with a way to use the computer to simplify restoring the cards to the correct books, numbering the books from left to right.
The first line contains the number of books (1 \le n \le 500000) in Vasya's father's library. In each of the next lines, there is the title of a book (lowercase Latin letters without spaces, no more than characters), and, separated by a space, the title of the book written on the card inside this book (lowercase Latin letters without spaces, no more than characters).
Output lines, each containing one integer. The number in the -th line denotes the number of the book in which lies the card that corresponds to the book with number (the book number is determined by the line on which it appears in the input data).
Example 1