Dad is strong...
Vasya's father is a professor who is not only skilled in mathematics but also has a meticulous nature. All the books on his shelves are neatly organized, each with a card inserted that lists the book's title and notes on its interesting aspects. Unlike many others, Vasya's father keeps his books pristine and doesn't write notes directly in them.
One day, while his father was away, Vasya invited a girl over. To keep his younger siblings from interrupting, he sent them to play in his father's study. The study remained suspiciously quiet. After the girl left, Vasya checked on the kids and realized he needed to act quickly if he wanted to avoid trouble. The books and cards were scattered and mixed up on the floor. Vasya hurriedly picked up the books, inserted a card into each one, and placed them back on the shelves. He remembered the order of the books and arranged them correctly.
When his father returned, the books were in their proper places, but the cards didn't match the books. To Vasya's dismay, his father decided to read a book after dinner. Upon discovering the mismatch, his father was puzzled and asked Vasya what had happened. Vasya confessed everything. Perhaps the dinner was particularly good, or maybe his father was reminiscing about his own courtship days, but he didn't punish the children. Instead, he devised a method to use the computer to simplify the card arrangement by numbering the books from left to right.
Input
The first line contains the number of books n (1 ≤ n ≤ 500000) in Vasya's father's library. Each of the next n lines contains the title of a book (lowercase Latin letters without spaces, no more than 10), followed by a space and the title written on the card inserted in that book (lowercase Latin letters without spaces, no more than 10).
Output
Output n lines, each containing one integer. The number on line i indicates the position of the book where the card corresponding to the book at position i is located (the book's position is determined by the line number in the input data).