#include <stdio.h>

int main(void){
	int t,n,s,f;
	
	while (scanf("%d", &t), t){
		scanf("%d", &n);
		while (n--){
			scanf("%d %d", &s, &f);
			t -= (f-s);
		}
		if (t<=0) puts("OK");
		else printf("%d\n", t);
	}
	return 0;
}
	
	