#include <bits/stdc++.h>
using namespace std;
int n, a[100010], s[100010], m;
int k, f;
int ans;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &k, &f);
    a[k]++;
    a[f + 1]--;
  }
  for (int i = 1; i <= n; i++) {
    s[i] = s[i - 1] + a[i];
    if (!s[i] || s[i] > 1) {
      printf("%d %d\n", i, s[i]);
      return 0;
    }
  }
  printf("OK\n");
  return 0;
}
