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