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