#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  int prevl = 0, prevr = 0;
  int ans = -1, freq = -1;
  bool f = 1;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    if (x != prevr + 1 and f == 1) {
      if (x > prevr + 1)
        ans = prevr + 1, freq = 0;
      else
        ans = x, freq = 2;
      f = 0;
    } else if (f == 0) {
      if (ans >= x and ans <= y) freq++;
    }
    prevl = x, prevr = y;
  }
  if (ans == -1 and prevr == n)
    cout << "OK" << endl;
  else {
    if (f == 0)
      cout << ans << " " << freq << endl;
    else
      cout << prevr + 1 << " " << 0 << endl;
  }
}
