main=interact$unlines.map(show.g.round.sqrt.read).tail.lines g k=11*k+k`mod`10