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