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