#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll OO = 1e18;
int di[8] = {0, 0, 1, -1, -1, 1, -1, 1};
int dj[8] = {1, -1, 0, 0, 1, 1, -1, -1};
int pre[101];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  while (m--) {
    int l, r;
    cin >> l >> r;
    l--;
    pre[l]++;
    pre[r]--;
  }
  for (int i = 1; i < n; i++) pre[i] += pre[i - 1];
  for (int i = 0; i < n; i++) {
    if (pre[i] != 1) {
      cout << i + 1 << " " << pre[i] << "\n";
      return 0;
    }
  }
  cout << "OK\n";
}
