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