Write a program to sequentially swap elements by their indexes in a given list. Indexes of the elements start with 0 and are always less than the size of the list.
Try to use standard methods for processing collections.
Input data format
The first line contains elements of the list. The second line contains the number of swaps. Then follow the lines with descriptions of the swaps. Each line contains two numbers: indexes of swapped elements.
Output data format
All elements of the modified list separated by spaces must be output in one line.