#include<stdio.h>
int main(void)
{
	int i,b;
	int t,n;
	int s,f;
	scanf("%d",&t);
	while(t!=0){
		b=0;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d %d",&s,&f);
			b+=f-s;
		}
		if(t<=b){
			printf("OK\n");
		}
		else{
			printf("%d\n",t-b);
		}
		scanf("%d",&t);
	}
	return 0;
}