#include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
  int n, m;
  int u, v;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    for (int j = u; j <= v; j++) {
      a[j]++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] != 1) {
      cout << i << " " << a[i];
      return 0;
    }
  }
  cout << "OK";
}
