#include <cstdio>
using namespace std;

int t, n, sum;

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

	return 0;
}