#include <cstdio>

int main(){
	int t;
	while(scanf("%d", &t),t){
		int n,s,f,sum=0;
		scanf("%d", &n);
		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);
	}
}