#include <bits/stdc++.h>
using namespace std;
int n, m, i, x, y, j, f[1000010];
inline int read() {
  int x = 0, f = 1;
  char ch = '\0';
  while (ch < '0' || ch > '9') f = (ch == '-') ? (0 - f) : f, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + (ch ^ '0'), ch = getchar();
  return x * f;
}
int main() {
  n = read();
  m = read();
  for (i = 1; i <= m; i++) {
    x = read();
    y = read();
    for (j = x; j <= y; j++) f[j]++;
  }
  for (i = 1; i <= n; i++)
    if (f[i] != 1) return printf("%d %d\n", i, f[i]), 0;
  printf("OK\n");
  return 0;
}
