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