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