#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[101];
int main() {
  scanf("%d%d", &n, &m);
  for (int d = 1; d <= m; d++) {
    int l, r;
    bool bb = 0;
    scanf("%d%d", &l, &r);
    for (int i = l; i <= r; i++) a[i]++;
  }
  for (int i = 1; i <= n; i++)
    if (a[i] != 1) {
      printf("%d %d", i, a[i]);
      return 0;
    }
  printf("OK");
}
