/*
判断x是不是素数
*/
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#define pi 3.1415927
#define ll long long
using namespace std;
int isprime(int n)
{
int i;
if(n<=1)
return 0;
for(i=2; i*i<=n; i++)
if(n%i==0)
return 0;
return 1;
}
int main()
{
int x;
while(cin>>x)
{
if(x==0)
continue;
if(isprime(x)==0)
cout<<"Sorry"<<endl;
else
cout<<"OK"<<endl;
}
return 0;
}
判断x是不是素数
*/
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#define pi 3.1415927
#define ll long long
using namespace std;
int isprime(int n)
{
int i;
if(n<=1)
return 0;
for(i=2; i*i<=n; i++)
if(n%i==0)
return 0;
return 1;
}
int main()
{
int x;
while(cin>>x)
{
if(x==0)
continue;
if(isprime(x)==0)
cout<<"Sorry"<<endl;
else
cout<<"OK"<<endl;
}
return 0;
}