main=mapM print[x|x<-[2..12^4],mod(2^x-2)x+(read.reverse.show)x==x]