#include <bits/stdc++.h>
using namespace std;
int sol[200];
int main() {
  memset(sol, sizeof(sol), 0);
  int d, n, n1, n2;
  scanf("%d%d", &d, &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &n1, &n2);
    for (int j = n1; j <= n2; j++) {
      sol[j]++;
    }
  }
  for (int i = 1; i <= d; i++) {
    if (sol[i] == 0) {
      printf("%d 0\n", i);
      return 0;
    }
    if (sol[i] != 1) {
      printf("%d %d\n", i, sol[i]);
      return 0;
    }
  }
  printf("OK\n");
}
