# range(n) = 0 to n-1 = total count is n because 0 counts as 1
# range(1, n+1) = 1 to n
# #Q6092
# totalCalled = int(input()) #how many times were numbers called in total?
# numbers = input().split() #what numbers were called?
# for i in range(totalCalled): #for all between 1 to totalCalled -1:
# numbers[i] = int(numbers[i]) #turn the num. of "numbers" into integers
# calledCount = [] #a list from 1-23, shows how many times each number was called in the list "numbers"
# for i in range(24): #from 0 to 23 (개수=24)
# calledCount.append(0) #make a list of zeros (in total 23 zeros)
# for i in range(totalCalled): #for all between 1 to totalCalled-1:
# calledCount[numbers[i]] += 1 #add one to the number called count list (counting how many times each number was called)
# for i in range(1, 24): #from 1 to 23:
# print(calledCount[i], end=' ') #print each corresponding number in the number called count list, don't start a new line but use space inbetween.
# #Q6093
# totalCalled = int(input())
# numbers = input().split()
#
# for i in range(totalCalled): # 0 ~ totalCalled-1
# numbers[i] = int(numbers[i])
#
# for i in range(totalCalled-1, -1, -1): # (totalCalled-1), 0 (-1까지 = 0), (add "-1" each time)
# print(numbers[i], end=' ')
# #Q6094
# n = int(input())
# a = input().split()
# for i in range(n):
# a[i] = int(a[i])
# a.sort(reverse=True)
# print(a[n-1])
# #Q1402:
# totalNum = int(input())
# numbers = input().split()
#
# for i in range(totalNum):
# numbers[i] = int(numbers[i])
#
# numbers.sort(reverse=True)
#
# for i in range(totalNum):
# print(numbers[i], end=' ')
# # Q1403
# howMany = int(input())
# numbers = input().split()
# for i in range(howMany):
# numbers[i] = int(numbers[i])
# for i in range(howMany):
# print(numbers[i])
# for i in range(howMany):
# print(numbers[i])
# # Q1412
# sentence = input() # 문자라서 ".split() 필요없다!!
# howMany = 0
# for i in range(ord('a'), ord('z')+1):
# print(chr(i), ':', sentence.count(chr(i)), sep='')
# Q1405
totalCount = int(input())
numbers = input().split()
for i in range(totalCount):
numbers[i] = int(numbers[i]) # just making integers
for i in range(totalCount): # 5 rows
for j in range(totalCount): # 5 columns
print(numbers[j], end=' ')
numbers.append(numbers[0])
numbers.pop(0)
print()