#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, m, num[N], res, val, en[N], st[N];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int l, r;
    cin >> l >> r;
    en[r + 1]++;
    st[l]++;
  }
  for (int i = 1; i <= n; i++) {
    num[i] = num[i - 1];
    num[i] += st[i] - en[i];
    if (num[i] != 1) {
      res = i;
      val = num[i];
      break;
    }
  }
  if (!res)
    cout << "OK\n";
  else
    cout << res << " " << val << "\n";
}
