#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main(){
	int t,n,s,f;
	int sum;
	
	while(scanf("%d",&t)){
		if(t==0)
		break;
		scanf("%d",&n);
		sum=0;
		for(int i=0;i<n;i++){
			scanf("%d %d",&s,&f);
			sum+=f-s;
		}
		if(sum>=t)
		printf("OK\n");
		else
		printf("%d\n",t-sum);
	}
}