main=mapM print$2:[a|a<-[3..12^4],2^a`mod`a==2,show a==reverse(show a)]