#include<iostream>
using namespace std;

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