#include <iostream>
using namespace std;

int main(){
	int t,n;
	while(cin >> t,t){
		int sum = 0;
		cin >> n;
		for(int i = 0;i < n;i++){
			int a,b;
			cin >> a >> b;
			sum += b - a;
		}
		if(sum >= t) cout << "OK" << endl;
		else cout << t - sum << endl;
	}
	return 0;
}