#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void solve() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > v(m);
  vector<int> res, temp(500, 1);
  for (int i = 0; i < m; i++) {
    cin >> v[i].first >> v[i].second;
  }
  for (int i = 1; i < v[0].first; i++) {
    res.push_back(i);
    temp[i] = 0;
  }
  for (int i = 1; i < m; i++) {
    for (int j = v[i - 1].second; j < v[i].first - 1; j++) {
      res.push_back(j + 1);
      temp[j + 1] = 0;
    }
    if (v[i - 1].second == v[i].first) {
      res.push_back(v[i - 1].second);
      temp[v[i - 1].second]++;
    }
  }
  for (int i = v[m - 1].second + 1; i <= n; i++) {
    res.push_back(i);
    temp[i] = 0;
  }
  if (res.size() == 0) {
    cout << "OK" << '\n';
  } else {
    cout << res[0] << " " << temp[res[0]] << '\n';
  }
}
int main() {
  fast();
  solve();
  return 0;
}
