#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> n >> m) {
    int bj[1233] = {0};
    while (m--) {
      int a, b;
      cin >> a >> b;
      for (int i = a; i <= b; i++) bj[i]++;
    }
    int fk = 0;
    for (int i = 1; i <= n; i++) {
      if (bj[i] != 1) {
        cout << i << " " << bj[i] << endl;
        fk = 1;
        break;
      }
    }
    if (!fk) {
      puts("OK");
    }
  }
}
