#include <bits/stdc++.h>
using namespace std;
int a, b, n, m, cub[110];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &a, &b);
    for (int j = a; j <= b; j++) {
      cub[j]++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (cub[i] != 1) {
      printf("%d %d", i, cub[i]);
      return 0;
    }
  }
  printf("OK");
}
