N = int(input()) ANS = [] for i in range(N): S = list(input()) while len(S)>1 and S[0] == "0": del S[0] ANS.append("".join(S)) print ("\n".join(ANS))