'''
Third Day-
Rotate Array - Leetcode
'''

def rotate(arr,k):
    arr_final = arr
    arr_final = arr_final[k:] + arr_final[:k]
    return arr_final

def main():
    arr = [int(x) for x in input().split()]
    k = int(input())
    res = rotate(arr,k)
    print(res)

if __name__ == '__main__':
    main()

e7ca7f7adf286ba9db0719a2e6e4159f25d1a737
<mask token>

<mask token>


def main():
    arr = [int(x) for x in input().split()]
    k = int(input())
    res = rotate(arr, k)
    print(res)


<mask token>

<mask token>


def rotate(arr, k):
    arr_final = arr
    arr_final = arr_final[k:] + arr_final[:k]
    return arr_final


def main():
    arr = [int(x) for x in input().split()]
    k = int(input())
    res = rotate(arr, k)
    print(res)


<mask token>

<mask token>


def rotate(arr, k):
    arr_final = arr
    arr_final = arr_final[k:] + arr_final[:k]
    return arr_final


def main():
    arr = [int(x) for x in input().split()]
    k = int(input())
    res = rotate(arr, k)
    print(res)


if __name__ == '__main__':
    main()

'''
Third Day-
Rotate Array - Leetcode
'''

def rotate(arr,k):
    arr_final = arr
    arr_final = arr_final[k:] + arr_final[:k]
    return arr_final

def main():
    arr = [int(x) for x in input().split()]
    k = int(input())
    res = rotate(arr,k)
    print(res)

if __name__ == '__main__':
    main()
