q = int(input()) for i in range(q): print(int(input(), 0))