#include <bits/stdc++.h>
using namespace std;
int a[105], b[105];
int ans[105];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
    for (int j = a[i]; j <= b[i]; j++) {
      ans[j]++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i] != 1) {
      cout << i << " " << ans[i] << endl;
      return 0;
    }
  }
  puts("OK");
  return 0;
}
