Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-ikki-elementni-almashtirish

Swapping two elements

Easy 1000 ms 128 MB 31%
Share

A positive integer $n$, an array of $n$ integers and two indices $i$ and $j$ are given. Swap the array elements at positions $i$ and $j$ and print the array.

Swapping two elements of an array

Input

The first line contains a positive integer $n$. The second line contains $n$ integers. The third line contains $i$ and $j$.

Output

One line with $n$ integers separated by spaces.

Note

$1 \le n \le 10^{4}$
$-1000 \le a_{k} \le 1000$
$1 \le i, j \le n$

Examples

Input #1
5
1 2 3 4 5
2 5
Output #1
1 5 3 4 2
Input #2
3
9 8 7
3 1
Output #2
7 8 9

Sign in to submit a solution

Signing up is free and takes a minute.