#include <bits/stdc++.h>
using namespace std;
const double EPS = 1E-10;
void openf(const string &fname, string mode = "") {
  string fin = fname + ".in";
  string fout = fname + ".out";
  if (mode.size() == 1 && mode[0] == 'r') freopen(fin.data(), "r", stdin);
  if (mode.size() == 1 && mode[0] == 'w') freopen(fout.data(), "w", stdout);
  if (mode.size() == 2) {
    freopen(fin.data(), "r", stdin);
    freopen(fout.data(), "w", stdout);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v(n, 0);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    for (int j = a; j <= b; j++) v[j]++;
  }
  for (int i = 0; i < n; i++) {
    if (v[i] != 1) {
      cout << i + 1 << " " << v[i];
      return 0;
    }
  }
  cout << "OK";
  return 0;
}
