#include <bits/stdc++.h>
using namespace std;
int d[102];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int t, t2;
    cin >> t >> t2;
    d[t]++, d[t2 + 1]--;
  }
  for (int i = 1; i <= n; i++) {
    d[i] = d[i - 1] + d[i];
    if (d[i] != 1) {
      cout << i << " " << d[i];
      return 0;
    }
  }
  cout << "OK";
  return 0;
}
