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