#include<iostream>
using namespace std;
int main() {
	int n, t, sum = 0, s, f;
	while(cin >> n&&n != 0) { 
		sum = 0;
		cin >> t;
		for (int i = 0; i < t; i++) {
			cin >> s >> f;
			sum += (f - s);
		}
		if (n <= sum) { cout << "OK" << endl; }
		else { cout << n - sum << endl; }
	}
}