System.in.eachLine{n,i->int k=(n as int)**0.5+0.5;~-i&&println(11*k+k%10)}