N = int(input()) for _ in range(N): S = input() i = 0 while i < 4 and S[i] == "0": i += 1 print(S[i:])