#include<iostream>
using namespace std;

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