#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int l, r, a[N];
void ins(int l, int r) {
  a[l] += 1;
  a[r + 1] -= 1;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &l, &r);
    ins(l, r);
  }
  for (int i = 1; i <= n; i++) a[i] += a[i - 1];
  for (int i = 1; i <= n; i++) {
    if (a[i] != 1) {
      printf("%d %d", i, a[i]);
      return 0;
    }
  }
  printf("OK");
  return 0;
}
