#55400: python兩行解


cyberpi0953.22914351419@gmail. ... (七草薺)


    input();x=input().split();s=int(input())
    print(*x[s:],*x[:s])