#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
typedef map<int,int> mapi;

int main() {
	int n,m[100],a[100],b[100];
	while(cin >> n && n!=0){
		mapi z;
		vector<int> v;
		int longs[200]={};
		for(int i=0;i<n;i++){
			cin >> m[i] >> a[i] >> b[i];
			v.push_back(a[i]);
			v.push_back(b[i]);
		}
		sort(v.begin(),v.end());
		
		for(int i=0;i<v.size();i++)
			if(i==0 || v[i]!=v[i-1])
				z.insert(mapi::value_type(v[i],i));
		int add[200]={},sum=0;
		for(int i=0;i<n;i++){
			add[z[a[i]]]+=m[i];
			add[z[b[i]]]-=m[i];
		}
		bool ans=true;
		for(int i=0;i<200;i++){
			sum+=add[i];
			if(sum>150)
			ans=false;
		}
		if(ans)
		cout << "OK" << endl;
		else
		cout << "NG" << endl;
	}
	// your code goes here
	return 0;
}