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