<reponame>shubhangini-tripathy/geeks_for_geeks<filename>binary_into_decimal_mul.py
N = int(input())
for i in range(N):
    W = str(int(input()))
    print(int(W, 2))

N = int(input())
for i in range(N):
    W = str(int(input()))
    print(int(W, 2))