#include <stdio.h>
#include <algorithm>

using namespace std;

typedef struct {
	int time;
	int data;
} EVENT;

bool operator< (const EVENT& a, const EVENT& b)
{
	if (a.time == b.time){
		return (a.data < b.data);
	}
	return (a.time < b.time);
}

int main(void)
{
	EVENT ev[200];
	int n;
	int ev_cnt;
	int wait;
	
	while (1){
		scanf("%d", &n);
		if (n == 0){
			break;
		}
		
		ev_cnt = 0;
		for (int i = 0; i < n; i++){
			int m, a, b;
			
			scanf("%d%d%d", &m, &a, &b);
			
			ev[ev_cnt].time = a;
			ev[ev_cnt++].data = m;
			ev[ev_cnt].time = b;
			ev[ev_cnt++].data = -m;
		}
		sort(ev, ev + ev_cnt);
		
		wait = 0;
		for (int i = 0; i < ev_cnt; i++){
			wait += ev[i].data;
			
			if (wait > 150){
				break;
			}
		}
		
		if (wait > 150){
			printf("NG\n");
		}
		else {
			printf("OK\n");
		}
	}
	
	return (0);
}