#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int arr[10005];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int l, r;
    cin >> l >> r;
    for (int j = l; j <= r; j++) {
      arr[j] += 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (arr[i] != 1) {
      cout << i << " " << arr[i] << endl;
      return 0;
    }
  }
  cout << "OK" << endl;
  return 0;
}
