Олимпиадный тренинг

Задача 22006. number exchanger


Задача

Темы:
 
At the initial moment, the array contains numbers from 1 to N in order (i-th number - 
in the i-th place). With an array, the following operation is performed sequentially:
take two numbers in places A and B and swap them. Required
print the array after doing these operations.
 
Input
The number N is written first (2<=N<=100). Next comes the number K - the number 
exchange operations (0<=K<=10000). Next comes K pairs of numbers - place numbers 
elements that are being exchanged.
 
Output
Print the elements of the array after performing these operations.
 
Input example:
10
2
1 3
3 5
 
Output example
3 2 5 4 1 6 7 8 9 10