#include <bits/stdc++.h>
int main() {
  int n, m;
  int aa[107];
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 1; i <= n; ++i) aa[i] = 0;
    int a, b;
    while (m--) {
      scanf("%d%d", &a, &b);
      for (int i = a; i <= b; ++i) ++aa[i];
    }
    int good = 1;
    for (int i = 1; i <= n; ++i) {
      if (aa[i] != 1) {
        printf("%d %d\n", i, aa[i]);
        good = 0;
        break;
      }
    }
    if (good) printf("OK\n");
  }
  return 0;
}
