#include <bits/stdc++.h>
using namespace std;
int sch[100];
int main() {
  int c, n, m, a, b;
  bool flag;
  while (cin >> n >> m) {
    flag = true;
    n++;
    for (int i = 0; i < n; i++) {
      sch[i] = 0;
    }
    while (m--) {
      cin >> a >> b;
      for (int i = a; i <= b; i++) {
        sch[i]++;
      }
    }
    for (int i = 1; i < n; i++) {
      if (sch[i] != 1) {
        cout << i << " " << sch[i];
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "OK\n";
    }
  }
}
