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