#include <bits/stdc++.h>
using namespace std;
int a[100010], b[100010];
long long mn = 1e9, mx = -1e9, ans, cnt, sm;
bool ok, okk, used[1000010], use[10010];
int main() {
  int n, m, x = 0, y = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int l, r;
    cin >> l >> r;
    for (int j = l; j <= r; j++) {
      a[j]++;
      if (a[j] > 1 && !ok) {
        x = j;
        ok = true;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      y = i;
      break;
    }
  }
  if (!ok && y != 0) {
    cout << y << " " << 0 << endl;
    return 0;
  }
  if (ok && y != 0) {
    if (y < x) {
      cout << y << " " << 0 << endl;
      return 0;
    } else {
      cout << x << " " << a[x] << endl;
      return 0;
    }
  }
  if (ok && y == 0) {
    cout << x << " " << a[x] << endl;
    return 0;
  }
  cout << "OK";
  return 0;
}
