~/algor $ cat problems/massiv-chapga-siklik-surish
Cyclic shift left by 1
Easy
1000 ms
128 MB
31%
A positive integer $n$ and an array of $n$ integers are given. Cyclically shift the array elements by $1$ position to the left (the first element moves to the last place) and print the resulting array.
Input
The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.
Output
One line with $n$ integers separated by spaces.
Note
$1 \le n \le 1000$
$-10^{9} \le a_{i} \le 10^{9}$
Examples
Input #1
5 10 20 30 40 50
Output #1
20 30 40 50 10
Input #2
3 1 2 3
Output #2
2 3 1