#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	int t;
	while (cin >> t, t){
		int n, s, f;
		int stime = 0;
		cin >> n;
		while (n--){
			cin >> s >> f;
			stime += (f - s);
		}
		if (t <= stime){
			cout << "OK" << endl;
		}
		else {
			cout << t - stime << endl;
		}
	}

	return 0;
}