#include <bits/stdc++.h>
using namespace std;
int N, M, T[111];
int main() {
  cin >> N >> M;
  for (int i = 0, L, R; i < M; i++) {
    cin >> L >> R;
    for (int j = L; j <= R; j++) T[j]++;
  }
  for (int i = 1; i <= N; i++)
    if (T[i] == 0 || T[i] > 1) {
      cout << i << " " << T[i] << endl;
      return 0;
    }
  cout << "OK" << endl;
  return 0;
}
