PROGRAMMING:Organize the team
In P.E. class, the P.E. teachers who teach mathematics don't think the team is right, so they adjust the team. Zhang San, you and Li Si change positions... After several adjustments, the team has finally become orderly.
###Input format:
The first line of input includes an integer n, indicating that there are n people in the class (1 < = n < = 100); The second line contains n integers, indicating the students' original order. The third line contains a number m (M > = 0), which means that the PE teacher has made a total of M exchanges; The following includes m lines, each line includes two numbers x and y, which indicate the students in x position and the students in y position exchange positions.
###Output format:
Output the team after the exchange, there is a space between the number of each two students.
###Input example:
```in
five
1 2 3 4 5
three
1 2
1 5
3 4
```
###Output example:
```out
5 1 4 3 2
```
answer:If there is no answer, please comment
###Input format:
The first line of input includes an integer n, indicating that there are n people in the class (1 < = n < = 100); The second line contains n integers, indicating the students' original order. The third line contains a number m (M > = 0), which means that the PE teacher has made a total of M exchanges; The following includes m lines, each line includes two numbers x and y, which indicate the students in x position and the students in y position exchange positions.
###Output format:
Output the team after the exchange, there is a space between the number of each two students.
###Input example:
```in
five
1 2 3 4 5
three
1 2
1 5
3 4
```
###Output example:
```out
5 1 4 3 2
```
answer:If there is no answer, please comment