queue = [1, 2, 3, 4, 5]
i=0
n=int(input())
while i<=1:
queue.pop(0)
print(queue)
i+=1
queue.append(n)
print(queue)

queue = [1, 2, 3, 4, 5]
i=0
n=int(input())
while i<=1:
queue.pop(0)
print(queue)
i+=1
queue.append(n)
print(queue)