from collections import deque
dq = deque()
for _ in range(int(input())):
    dq.append(input())
    if len(dq) > 4: dq.popleft()
    for i in range(-1, -len(dq) - 1, -1): print(f'{-i}={dq[i]}', end=' ')
    print()