#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  int flag = 1, res, sum;
  int num[500];
  cin >> n >> m;
  sum = 0;
  for (int i = 1; i <= 2 * m; i++) cin >> num[i];
  if (num[1] != 1) {
    res = 1;
    sum = 0;
    flag = 0;
  }
  for (int i = 2; i <= 2 * m - 2; i += 2) {
    if (num[i] != num[i + 1] - 1) {
      if (num[i] == num[i + 1] && flag) {
        res = num[i];
        sum = 2;
      }
      if (!flag && res == num[i] && res == num[i + 1]) {
        sum++;
      }
      if (num[i] != num[i + 1] && flag) {
        res = num[i] + 1;
        sum = 0;
      }
      flag = 0;
    }
  }
  if (num[2 * m] != n && flag) {
    flag = 0;
    res = num[2 * m] + 1;
    sum = 0;
  }
  if (flag)
    cout << "OK" << endl;
  else
    cout << res << " " << sum << endl;
  return 0;
}
