#include <bits/stdc++.h>
using namespace std;
int n, m, a, b;
int d[210];
int main() {
  int T;
  T = 1;
  while (T--) {
    cin >> n >> m;
    memset(d, 0, sizeof(d));
    for (int i = 0; i < m; i++) {
      cin >> a >> b;
      d[a]++, d[b + 1]--;
    }
    int cnt = 0;
    for (int i = 1; i < n + 1; i++) {
      cnt += d[i];
      if (cnt != 1) {
        cout << i << ' ' << cnt;
        return 0;
      }
    }
    cout << "OK";
  }
  return 0;
}
