#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
int cnt[109];
void solve() {
  int n, m;
  cin >> n >> m;
  int i, a, b;
  for (i = 1; i <= m; i++) {
    cin >> a >> b;
    for (int j = a; j <= b; j++) cnt[j]++;
  }
  for (i = 1; i <= n; i++)
    if (cnt[i] != 1) {
      cout << i << ' ' << cnt[i];
      return;
    }
  cout << "OK";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
