#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, c[1001];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &a, &b);
    for (int j = a; j <= b; j++) c[j]++;
  }
  for (int i = 1; i <= n; i++) {
    if (c[i] != 1) {
      printf("%d %d", i, c[i]);
      return 0;
    }
  }
  puts("OK");
  return 0;
}
