LearnPy Hub
← Lists problems
Medium

Rotate Right by k

Read integers and k. Rotate the list right by k places (the last k items move to the front) and print it. k may be bigger than the list length.

Input

Two lines.

Output

One line.

Sample 1

Input
1 2 3 4 5
2
Output
4 5 1 2 3

Sample 2

Input
1 2 3
3
Output
1 2 3
solution.py
Output appears here
Rotate Right by k · Python practice problem · LearnPy Hub