Company: Walmart sparkplug
Difficulty: medium
26 Botanical Garden Entry System In a botanical garden, people can book tickets online as well as at the ticket counter directly. Each ticket has a ticket number and a slot number. The security in-charge allows people to enter according to their ticket numbers. The people who have time slot 1 can enter the garden before anyone with time slot 2. If more than one person from the same time slot comes, they will be allowed to enter according to their ticket numbers. Write a program to print the ticket numbers of N people in the order in which they will be allowed to enter the garden. You must read the input from STDIN (standard input) and write the output to STDOUT (standard output). Do not print arbitrary strings while reading the input or printing the output as those would be counted as wrong answers. Constraints 1 ≤ N ≤ 1000 The ticket numbers of people in any slot are unique. Input Format The first line of input contains the number of tickets, N. The next N lines contain two integers s