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