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