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