#include <bits/stdc++.h>
using namespace std;
const int MaxN = 104, MaxC = 0x3F3F3F3F, NA = -1;
int n, m, d[MaxN];
int main(void) {
  int i, j, a, b;
  while (scanf(" %d %d", &n, &m) != EOF) {
    memset(d, 0, sizeof(d));
    for (i = 0; i < m; i++) {
      scanf(" %d %d", &a, &b);
      for (j = a; j <= b; j++) d[j]++;
    }
    for (j = 1; j <= n; j++) {
      if (d[j] != 1) {
        printf("%d %d\n", j, d[j]);
        break;
      }
    }
    if (j == n + 1) printf("OK\n");
  }
  return 0;
}
