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