for i in range(int(input())): s = input() while s[0] == "0" and len(s) > 1: s = s[1:] print(s)