#include <bits/stdc++.h>
using namespace std;
long n, m, i, a, b, j, d[1000];
int main() {
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> a >> b;
    for (j = a; j <= b; j++) d[j]++;
  }
  for (i = 1; i <= n; i++)
    if (d[i] != 1) {
      cout << i << " " << d[i] << endl;
      return 0;
    }
  cout << "OK" << endl;
}
