#include <bits/stdc++.h>
using namespace std;
const int sz = 105;
int main() {
  int n, m, a[sz] = {0};
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    for (int j = x; j <= y; j++) a[j]++;
  }
  int d = -1, kol = -1;
  for (int i = 1; i <= n; i++)
    if (a[i] == 0 || a[i] > 1) {
      kol = a[i];
      d = i;
      break;
    }
  if (d == -1)
    cout << "OK";
  else
    cout << d << " " << kol;
  return 0;
}
