The N cows (1 ≤ N ≤ 100) of Farmer John are lined up. The i-th cow on the left has label i, for all 1≤i≤N.
The FD ordered the cows to repeat exactly K (1 ≤ K ≤10
9) times the following two-step process:
The sequence of cows at positions A1…A2 on the left reverses their order (1≤A
1<A
2≤N).
Then the sequence of cows at positions B1…B2 on the left reverses their order (1≤B
1<B
2≤N).
Output the resulting order of cows for all i 1 ≤ i≤ N after running this process exactly K times.
Input
The first line contains N and K. The second line contains A
1 and A
2, the third line contains B
1 and B
2 sub>.
Imprint
On the i-th line print the label of the i-th cow on the left after the process of all exchanges is completed.
Examples
# |
Input |
Output |
Explanation |
1 |
7 2
25
3 7
|
1
2
4
3
5
7
6
|
Initially, the order of cows from left to right is [1,2,3,4,5,6,7]
After the first step of the process, the order will be [1,5,4,3,2,6,7]
After the second step of the process, the order will become [1,5,7,6,2,3,4].
Repeating both steps one more time we get the result shown in the output. |