N = int(input()) for _ in range(N): S = input().lstrip('0') if len(S) == 0: S = '0' print(S)