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