N = int(input()) if 1<=N<=10000: for _ in range(N): S = input() if len(S)==5: print(int(S))