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