Program to split the list into two halfs and add first part at the end.
n = int(input())
li = list(map(int,input().split()))[:n]
li = li[n//2:n] + li[:n//2]
print(*li)
li = list(map(int,input().split()))[:n]
li = li[n//2:n] + li[:n//2]
print(*li)
Input
5
1 2 3 4 5
Output
3 4 5 1 2
5
1 2 3 4 5
Output
3 4 5 1 2