n = io.read("*n") for i = 1, n do a = io.read("*n") b = 1LL * a * (1LL + a) b = tostring(b):gsub("LL", "") print(b) end