#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, p, q, c, i, j, sum = 0, cnt = 0, ans, res;
  cin >> n >> m;
  vector<long long> a(105, 0);
  for (i = 1; i <= m * 2; i += 2) {
    cin >> p >> q;
    for (j = p; j <= q; j++) a[j]++;
  }
  for (i = 1; i <= n; i++) {
    if (a[i] != 1) {
      cout << i << " " << a[i] << endl;
      return 0;
    }
  }
  cout << "OK" << endl;
  return 0;
}
