#include <bits/stdc++.h>
using namespace std;
int p[101];
int main() {
  int n, m, a, b, i, j, s, f = 1;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    for (j = a; j <= b; j++) {
      p[j] += 1;
    }
  }
  for (i = 1; i <= n; i++) {
    if (p[i] == 0 || p[i] > 1) {
      cout << i << " " << p[i];
      f = 0;
      break;
    }
  }
  if (f) cout << "OK";
}
