#include <bits/stdc++.h>
using namespace std;
int n, m, a[1000];
int main() {
  memset(a, 0, sizeof a);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    for (int j = x; j <= y; ++j) ++a[j];
  }
  int i = 1;
  while (a[i] == 1 && i < n) ++i;
  if (a[i] == 1)
    cout << "OK";
  else
    cout << i << ' ' << a[i];
  return 0;
}
