#include<iostream>
using namespace std;

int main(void){
int n,t,s,f,sum;
  while(cin >> t&&t){
    cin >> n;
    sum = 0;
    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;
}
