#include <bits/stdc++.h>
int main() {
  int n, m, h[105] = {0}, x, y, i, j;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    for (j = x; j <= y; j++) h[j]++;
  }
  for (i = 1; i <= n; i++)
    if (h[i] != 1) break;
  if (i == n + 1)
    printf("OK\n");
  else
    printf("%ld %ld\n", i, h[i]);
  return (0);
}
