#include <iostream>
using namespace std;

int main(void)
{
	int s,n,a,b;

	while(cin >> s, s){
		cin >> n;
		int now = 0;
		while(--n, n >= 0){
			cin >> a >> b;
			now += (b - a);
		}
		if(now >= s)
			cout << "OK";
		else
			cout << s-now;
		cout << endl;
	}

	return 0;
}