local ffi = require("ffi") local C = ffi.C ffi.cdef[[ long long atoll(const char*); ]] local function lltonumber(str) return C.atoll(str) end local q = io.read("*n", "*l") for iq = 1, q do local s = lltonumber(io.read()) local min, max = 1LL, 1000000007LL while 1LL < max - min do local mid = (min + max) / 2LL if mid * mid <= s then min = mid else max = mid end end min = tostring(min):gsub("LL", "") print(min) end