#P5550. Chino的数列

Chino的数列

Description

Chino is given nn numbers a1...ana_1...a_n, and two constants s,ms, m. She will repeatedly perform kk rounds of operations on these nn numbers. Each round includes the following steps:

  1. swap(as,am)\operatorname{swap}(a_s,a_m) (swap asa_s and ama_m).

  2. Shift all nn numbers forward by one position (the 1st number moves to the nn-th position).

Chino wants to know what these nn numbers are after kk rounds of operations.

Orz yky,dyh,wjk,jjy,cxr,gsy,cpy,zcy,tyz,yy,hz,zhr,ygg.

Input Format

The first line contains four numbers: n,s,m,kn, s, m, k.

The next line contains nn numbers, representing a1,a2...ana_1, a_2...a_n.

Output Format

Output one line with nn numbers, representing a1,a2...ana_1, a_2...a_n.

4 1 2 3
1 2 3 4
1 2 3 4

Hint

For 40%40\% of the testdata, 1k1071 \leq k \leq 10^7.

For 100%100\% of the testdata, 1n801 \leq n \leq 80, 1s,mn1 \leq s, m \leq n, 1k10181 \leq k \leq 10^{18}.

All numbers fit in long long.

Translated by ChatGPT 5