#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int n, m, x, y, c[maxn];
int lowbit(int x) { return x & -x; }
void add(int x, int k) {
  for (; x <= n; x += lowbit(x)) {
    c[x] += k;
  }
}
int Query(int x) {
  int ans = 0;
  for (; x; x -= lowbit(x)) {
    ans += c[x];
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &x, &y);
    add(x, 1), add(y + 1, -1);
  }
  for (int i = 1; i <= n; ++i) {
    if (Query(i) != 1) {
      printf("%d %d", i, Query(i));
      return 0;
    }
  }
  puts("OK");
  return 0;
}
