#include<stdio.h>
#include<math.h>
int main()
{
int x,y,i,j,t,n,p;
while(scanf("%d%d",&x,&y)&&(x||y))
{
p=0;
if(x>y) {t=y;y=x;x=t;}
for(i=x;i<=y;i++)
{
n=i*i+i+41;
for(j=2;j<=sqrt((double)n);j++)
if(n%j==0) {p=1;break;}
if(p) break;
}
if(p) printf("Sorry\n");
else printf("OK\n");
}
return 0;
}
#include<math.h>
int main()
{
int x,y,i,j,t,n,p;
while(scanf("%d%d",&x,&y)&&(x||y))
{
p=0;
if(x>y) {t=y;y=x;x=t;}
for(i=x;i<=y;i++)
{
n=i*i+i+41;
for(j=2;j<=sqrt((double)n);j++)
if(n%j==0) {p=1;break;}
if(p) break;
}
if(p) printf("Sorry\n");
else printf("OK\n");
}
return 0;
}