#include <bits/stdc++.h>
using namespace std;
int i, j, n, m, q, u, v, l, r, cnt[1010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> l >> r;
    for (j = l; j <= r; j++) {
      cnt[j]++;
    }
  }
  for (i = 1; i <= n; i++) {
    if (cnt[i] != 1) {
      cout << i << " " << cnt[i] << endl;
      return 0;
    }
  }
  cout << "OK\n";
  return 0;
}
