#include <bits/stdc++.h>
using namespace std;
int cnt[101];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    for (int j = x; j <= y; ++j) ++cnt[j];
  }
  bool ans = true;
  int s1 = 0;
  for (int i = 1; i <= n; ++i)
    if (cnt[i] != 1) {
      ans = false;
      s1 = i;
      break;
    }
  if (ans)
    puts("OK");
  else
    printf("%d %d\n", s1, cnt[s1]);
  return 0;
}
