PROGRAMMING:A gang of people
"One help one study group" is a common learning organization in primary and secondary schools. Teachers put the students with high academic performance in a group with the students with low academic performance. In this question, please write a program to help the teacher automatically complete the assignment, that is, after getting the ranking of the whole class, among the students who have not yet been grouped, divide the students with the highest ranking and the students with the lowest ranking into a group.
###Input format:
Enter the first line to give a positive even number 'n' ($$$Le $$50), that is, the number of students in the class. After that, the 'n' line gives each student's gender (0 for female, 1 for male) and name (a non empty string of no more than 8 English letters) in the order of ranking from high to low, separated by a space. It is guaranteed that the ratio of male to female in this class is 1:1, and there is no parallel place.
###Output format:
Each line outputs the names of a group of two students separated by a space. The students with high ranking are in the front, and the students with low ranking are in the back. The output order of the group is arranged from high to low according to the ranking of the front students.
###Input example:
```in
eight
0 Amy
1 Tom
1 Bill
0 Cindy
0 Maya
1 John
1 Jack
0 Linda
```
###Output example:
```out
Amy Jack
Tom Linda
Bill Maya
Cindy John
```
answer:If there is no answer, please comment
###Input format:
Enter the first line to give a positive even number 'n' ($$$Le $$50), that is, the number of students in the class. After that, the 'n' line gives each student's gender (0 for female, 1 for male) and name (a non empty string of no more than 8 English letters) in the order of ranking from high to low, separated by a space. It is guaranteed that the ratio of male to female in this class is 1:1, and there is no parallel place.
###Output format:
Each line outputs the names of a group of two students separated by a space. The students with high ranking are in the front, and the students with low ranking are in the back. The output order of the group is arranged from high to low according to the ranking of the front students.
###Input example:
```in
eight
0 Amy
1 Tom
1 Bill
0 Cindy
0 Maya
1 John
1 Jack
0 Linda
```
###Output example:
```out
Amy Jack
Tom Linda
Bill Maya
Cindy John
```
answer:If there is no answer, please comment