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