#include <stdio.h>
#include <iostream>

using namespace std;

int main() {

	int t,s,f,n;

	while (1) {
		cin >> t;
		if (t == 0) {
			break;
		}
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> s >> f;
			t = t - (f - s);
		}
		if (t > 0) {
			cout << t << endl;
		}else {
			cout << "OK" << endl;
		}
	}

	return 0;
}