#include<iostream>
using namespace std;

int main(){
	int t,n,s[22],f[22],i,x;
	
	while(cin>>t){
	      if(t==0){
	          return 0;
	          }
	cin>>n;
	      
	x=0;      
	
	for(i=0;i<n;i++){
	    cin>>s[i]>>f[i];
	    x=x+f[i]-s[i];
	    }
	
	if(x-t>=0){
	   cout<<"OK"<<endl;
	   }else{
	   cout<<t-x<<endl;
	   }
	
	}
	
	return 0;
	}