//ignore header filesintmain(intargc,charconst*argv[]){boolN[2000000];N[0]=true;N[1]=true;for(unsignedlonglongi=2;i<2000000;i++){if(!N[i]){for(unsignedlonglongj=i+i;j<2000000;j=j+i){N[j]=true;}}}intn;while(~scanf("%d",&n)){intp=1;intk=n;if(!N[n]){while(k/10!=0){k=k/10;p=p*10;}k=n;intnn=0;while(k!=0){nn=nn+(k%10)*p;k=k/10;p=p/10;}//printf("%d\n",nn);if(!N[nn]&&nn!=n){printf("%d is emirp.\n",n);}else{printf("%d is prime.\n",n);}}else{printf("%d is not prime.\n",n);}}return0;}