#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
  int n, m, a, b, i, j;
  while (scanf("%d%d", &n, &m) != EOF) {
    mp.clear();
    while (m--) {
      scanf("%d%d", &a, &b);
      for (i = a; i <= b; i++) mp[i]++;
    }
    int p = 0;
    for (i = 1; i <= n; i++) {
      if (mp[i] != 1) {
        printf("%d %d\n", i, mp[i]);
        p = 1;
        break;
      }
    }
    if (p == 0) printf("OK\n");
  }
  return 0;
}
