#include <iostream>
using namespace std;

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