#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#define pb push_back
#define fi first
#define sc second
using namespace std;
int main()
{
	while(1)
	{
		int n; cin >> n;
		if(n == 0) return 0;
		map<long long,vector<int> >ma;
		for(int i=0;i<n;i++)
		{
			long long a,b,c;
			cin >> a >> b >> c;
			ma[b*2].push_back(a);
			ma[c*2-1].push_back(a);
		}
		int cur = 0;
		for(map<long long,vector<int> >::iterator it = ma.begin();it!=ma.end();++it)
		{
			if((it->fi)%2==0) for(int i=0;i<(it->sc).size();i++) cur += (it->sc)[i];
			else for(int i=0;i<(it->sc).size();i++) cur -= (it->sc)[i];
			if(cur>150) goto dead;
		}
		puts("OK"); continue; dead:; puts("NG");
	}
}