n=1;exec"if sorted(`n*n`+`n**3`)==list('0123456789'):print n\nn+=1\n"*10000