from collections import deque
dq = deque([1, 18, '27', 2, 'python', 26, 19, 50])
print(dq)
N = 3
dq.rotate(N)
print(dq)
N = -3
dq.rotate(N)
print(dq)
N = -1
dq.rotate(N)
print(dq)
'''
run:
deque([1, 18, '27', 2, 'python', 26, 19, 50])
deque([26, 19, 50, 1, 18, '27', 2, 'python'])
deque([1, 18, '27', 2, 'python', 26, 19, 50])
deque([18, '27', 2, 'python', 26, 19, 50, 1])
'''