#include <bits/stdc++.h>
using namespace std;
int main() {
  int hols[101], n, m;
  for (int i = 0; i <= 100; ++i) hols[i] = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int s, e;
    scanf("%d %d", &s, &e);
    for (int j = s; j <= e; ++j) hols[j]++;
  }
  for (int i = 1; i <= n; ++i)
    if (hols[i] == 0 || hols[i] > 1) {
      printf("%d %d\n", i, hols[i]);
      return 0;
    }
  printf("OK\n");
  return 0;
}
