#include<cstdio>
#include<cstring>
#include<cctype>
#include<stdlib.h>
#include<algorithm>
#define LL long long
using namespace std;
LL mul(LL a,LL b,LL c){ return ((a*b-(LL)((long double)a/c*b+1e-8)*c)%c+c)%c; }
LL Pow(LL a,LL b,LL c,LL ret=1){for(;b;b>>=1,a=mul(a,a,c))if(b&1)ret=mul(ret,a,c);return ret;}
const int base[6]={2,3,7,31,61,24251};
inline bool Miller_Rabin(LL x)
{
if(x < 2) return 0;
for(int i=0;i<6;i++) if(base[i]==x) return 1;
if(!(x&1)||!(x%3)||!(x%61)||!(x%24251))return false;
LL res=x-1,k=0,now,pre,tim;
for(;!(res&1);k++,res>>=1);
for(int i=0;i<6 && base[i] < x;i++)
{
pre = Pow(base[i],res,x);
for(tim=k;tim && pre!=1;tim--,pre=now)
if((now=mul(pre,pre,x))==1 && pre!=1 && pre!=x-1) return 0;
if(pre!=1) return 0;
}
return 1;
}
int main()
{
}