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