#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e7 + 5;
int n, m;
int d[MAXN];
int main() {
  cin >> n >> m;
  for (register int i = 1, l, r; i <= m; ++i) {
    cin >> l >> r;
    d[l]++, d[r + 1]--;
  }
  for (register int i = 1; i <= n; ++i) d[i] += d[i - 1];
  for (register int i = 1; i <= n; ++i) {
    if (d[i] != 1) {
      cout << i << ' ' << d[i] << endl;
      return 0;
    }
  }
  puts("OK");
  return 0;
}
