import sys input = lambda: sys.stdin.readline().rstrip() from collections import deque # ----------------------- # n = int(input()) for _ in range(n): q = deque(list(input())) while q and q[0] == '0': q.popleft() print(''.join(q))