n = int(input()) for i in range(n): s = input() for j in range(5): if s[j] != "0" or j == 4: print(s[j:]) break