Problem

4/10

Pairwise permutation

Theory Click to read/hide

To change the value by index in the list, use name.set(index,value); 
 

arr.set(0,10); 

Problem

Given a one-dimensional array of dimension N (2<=N<=20) N-even.
Swap pairs of its elements. That is, the first with the second, the third  with the fourth, etc.

Input: 
- the first line contains the number N - the number of array elements;
- the second line contains the values ​​of the array elements.

Output: you want to display the resulting array.
 
Examples
# Input Output
1 4
1 2 3 4
2 1 4 3