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