#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, a[105];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    cin >> x >> y;
    a[x]++;
    a[y + 1]--;
  }
  for (long long i = 1; i <= n; i++) {
    a[i] = a[i - 1] + a[i];
    if (a[i] == 0) {
      cout << i << " " << 0 << endl;
      return 0;
    }
    if (a[i] > 1) {
      cout << i << " " << a[i] << endl;
      return 0;
    }
  }
  cout << "OK" << endl;
  return 0;
}
