#include <bits/stdc++.h>
using namespace std;
int a[101];
int main() {
  int n, m, x, y;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    for (int j = x; j <= y; j++) {
      a[j]++;
    }
  }
  int ok = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] != 1) {
      printf("%d %d", i, a[i]);
      ok = 0;
      break;
    }
  }
  if (ok) {
    cout << "OK";
  }
  return 0;
}
