#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, k, dx, x, y, j;
  int wat[101];
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) wat[i] = 0;
  x = 0;
  y = 0;
  int cnt = 1;
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &x, &y);
    for (j = x; j <= y; j++) wat[j]++;
  }
  for (i = 1; i <= n; i++) {
    if (wat[i] != 1) {
      printf("%d %d\n", i, wat[i]);
      break;
    }
    if (i == n) printf("OK\n");
  }
  return 0;
}
