#include <stdio.h>

int main()
{
	int A,B,K;

	scanf("%d",&K);
	scanf("%d %d",&A,&B);

	for (int i = a;i <= b;i++){
		if (i % k == 0){
			printf("OK\n");
		}else{
			printf("NG\n");
		}

	return 0;
}
