#include <bits/stdc++.h>
using namespace std;
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
void file() {}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
}
int main() {
  file();
  fast();
  int n, m;
  cin >> n >> m;
  vector<int> v1(n + 9, 0);
  while (m--) {
    int a, b;
    cin >> a >> b;
    v1[b + 1]--, v1[a]++;
  }
  for (int i = 1; i <= n; i++) v1[i] += v1[i - 1];
  for (int i = 1; i <= n; i++) {
    if (!v1[i] || v1[i] > 1) return cout << i << ' ' << v1[i] << "\n", 0;
  }
  cout << "OK\n";
  return 0;
}
