#include <bits/stdc++.h>
const int N = 500005;
int n;
int t[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    t[a]++;
    t[b + 1]--;
  }
  int s = 0;
  for (int i = 1; i <= n; i++) {
    s += t[i];
    if (s != 1) {
      printf("%d %d", i, s);
      return 0;
    }
  }
  printf("OK");
  return 0;
}
