#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 5;
const int mod = 1e9 + 7;
int n, m;
int c[maxn];
int lowbit(int x) { return x & (-x); }
void add(int pos, int x) {
  while (pos <= n) {
    c[pos] += x;
    pos += lowbit(pos);
  }
}
void update(int l, int r) { add(l, 1), add(r + 1, -1); }
int get(int pos) {
  int ans = 0;
  while (pos > 0) {
    ans += c[pos];
    pos -= lowbit(pos);
  }
  return ans;
}
void solve() {}
int main() {
  cin >> n >> m;
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    update(a, b);
  }
  bool flag = false;
  int pos;
  for (int i = 1; i <= n; i++) {
    if (get(i) != 1) {
      flag = true;
      pos = i;
      break;
    }
  }
  if (flag) {
    cout << pos << " " << get(pos) << endl;
  } else {
    cout << "OK" << endl;
  }
  solve();
  return 0;
}
