#include <bits/stdc++.h>
using namespace std;
int cont[102] = {0};
int main() {
  int i, n, m, ok = 0, a, b;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &a, &b);
    cont[a]++;
    cont[b + 1]--;
  }
  for (i = 2; i <= n; i++) {
    cont[i] = cont[i - 1] + cont[i];
  }
  for (i = 1; i <= n; i++) {
    if (cont[i] == 0) {
      printf("%d %d\n", i, cont[i]);
      ok = 1;
      break;
    } else if (cont[i] > 1) {
      printf("%d %d\n", i, cont[i]);
      ok = 1;
      break;
    }
  }
  if (ok == 0) printf("OK\n");
}
