#CCBCHBAHAI0000101. Hoán đổi hai phần tử theo chỉ số
Hoán đổi hai phần tử theo chỉ số
Swap Two Elements by Index
Source: Phuoc Hung OJ
Version: Phuoc Hung OJ Extended
Problem
Given and valid 0-based indices , swap and . If , the array is unchanged. For the result , , , and for every other index .
Input
The first line contains , the second line contains the array, and the last line contains with .
Output
Print the array after the swap.
Subtask
Subtask 1 (20 points): .
Subtask 2 (30 points): .
Subtask 3 (50 points): .
Example
Input
5
10 20 30 40 50
1 4
Output
10 50 30 40 20
Explanation
The values at indices 1 and 4 are exchanged.