Binary codes

Time Limit: 1000MS

Memory Limit: 65536K

Description

Consider a binary string (b1…bN) with N binary digits. Given such a string, the matrix of Figure 1 is formed from the rotated versions of the string.
b1b2bN−1bN
b2b3bNb1
bN−1bNbN−3bN−2
bNb1bN−2bN−1

Input

The first line contains one integer N ≤ 3000, the number of binary digits in the binary string. The second line contains N integers, the binary digits in the last column from top to bottom.

Output

The first line contains N integers: the binary digits in the first row from left to right.

Sample Input

5
1 0 0 1 0

Sample Output

0 0 0 1 1

Hint

Source

N/A

提交代码