N=int(input()) for i in range(N): T=list(input()) i=-1 while True: i+=1 if T[i]!="0": break temp=T[i:] print("".join(temp))