#include <bits/stdc++.h>
const double eps = 1e-8;
const double pi = 3.1415926535897932;
const long long I64M = 1000000 * 1000000 * 1000000LL;
using namespace std;
ifstream in("input.txt", ifstream::in);
ofstream out("output.txt", ofstream::out);
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> A(n + 1);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    for (int j = a; j <= b; j++) {
      A[j]++;
    }
  }
  for (int i = 1; i <= n; i++)
    if (A[i] != 1) {
      cout << i << ' ' << A[i];
      return 0;
    }
  cout << "OK";
  return 0;
}
