#include <bits/stdc++.h>
using namespace std;

int main() {
  int t, n, s, f;
  while (cin >> t, t) {
    cin >> n;
    int sum = 0;
    while (n--) {
      cin >> s >> f;
      sum += f - s;
    }
    if (sum >= t) cout << "OK\n";
    else cout << t - sum << "\n";
  }
}
