local n = io.read("*n") for i = 1, n do local p = io.read("*n") if p == 2 then print(2) else local z = (p - 1LL) * (p - 1LL) z = tostring(z):gsub("LL", "") print(z) end end