#include<stdio.h>
int main(void)
{
	int t,n,i,s,f,sum;
	while(1){
		sum=0;
		scanf("%d",&t);
		if(t==0)break;
		scanf("%d",&n);
		for(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);
		}
	}
	return 0;
}