#include <iostream>
#include <cmath>
using namespace std;
bool flag;
int fun(int temp){
for(int i=2; i<=sqrt(temp); i++){
if(temp%i==0)
flag=false;
}
}
int main(){
int x, y;
while(cin>>x>>y&&(x||y)){
flag=true;
if(x>y){int temp=x; x=y; y=temp;}
if(x<-39||y>50)return 0;
for(int i=x; i<=y; i++){
fun(i*i+i+41);
}
if(flag) cout<<"OK"<<endl;
else cout<<"Sorry"<<endl;
}
return 0;
}