#include <bits/stdc++.h>
using namespace std;
int dp[(int)2e5 + 100];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int l, r;
    cin >> l >> r;
    dp[l]++;
    dp[r + 1]--;
  }
  for (int i = 2; i <= n; i++) dp[i] += dp[i - 1];
  for (int i = 1; i <= n; i++) {
    if (dp[i] == 0) {
      cout << i << " " << dp[i];
      return 0;
    }
    if (dp[i] > 1) {
      cout << i << " " << dp[i];
      return 0;
    }
  }
  cout << "OK";
  return 0;
}
