#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[101] = {0}, n, m, x, y;
  cin >> n >> m;
  for (int a = 0; a < m; a++) {
    cin >> x >> y;
    for (int b = x; b <= y; b++) arr[b]++;
  }
  for (int a = 1; a <= n; a++) {
    if (arr[a] != 1) cout << a << " " << arr[a] << flush, exit(0);
  }
  cout << "OK";
}
