#include <bits/stdc++.h>
int hash[105];
int main() {
  int n, m;
  int a, b;
  int i, time;
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(hash, 0, sizeof(hash));
    for (i = 0; i < m; i++) {
      scanf("%d%d", &a, &b);
      hash[a]++;
      hash[b + 1]--;
    }
    time = 0;
    for (i = 1; i <= n; i++) {
      time += hash[i];
      if (time != 1) break;
    }
    if (i != n + 1) {
      printf("%d %d\n", i, time);
    } else {
      printf("OK\n");
    }
  }
}
