t = int(input())
from decimal import *
for _ in range(t):
    n = str(input())
    print(int(Decimal(n).sqrt()))