#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int colour[1005];
  for (int i = 0; i < 120; i++) colour[i] = 0;
  bool f = false;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    if (x > y) swap(x, y);
    for (int j = x; j <= y; j++) {
      colour[j]++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (colour[i] != 1) {
      f = true;
    }
  }
  if (f == false) {
    cout << "OK" << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (colour[i] != 1) {
      cout << i << " " << colour[i] << endl;
      return 0;
    }
  }
}
