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