def main(): n=int(input()) y=[str(x) for x in input().split()] z=int(input()) print(*y[z:],*y[:z])if __name__ == "__main__": main()
或者下方
n=int(input())y=[str(x) for x in input().split()]z=int(input())print(*y[z:],*y[:z])