var n:word;begin readln;repeat read(n);n:=round(n**0.5);writeln(n*11+n mod 10)until 0>0end.