#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v(n + 10, 0);
  int a, b;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    v[a]++;
    v[b + 1]--;
  }
  for (int i = 1; i <= n; i++) {
    v[i] += v[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    if (v[i] != 1) {
      cout << i << ' ' << v[i] << endl;
      return 0;
    }
  }
  cout << "OK" << endl;
  return 0;
}
