#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

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