#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n;
	int d[101][3];
	int f;
	int tmp;
	while(cin>>n,n){
		f=1;
		for(int i=1;i<=n;i++)cin>>d[i][0]>>d[i][1]>>d[i][2];
		for(int i=1;i<=n;i++)for(int j=1;j<n;j++)if(d[j][1]>d[j+1][1])for(int k=0;k<3;k++)swap(d[j][k],d[j+1][k]);
		
		for(int i=1;i<=n;i++){
			for(int j=1;j<=2;j++){
				tmp=0;
				//cout<<d[i][j]<<" ";
				for(int k=1;k<=n;k++){
					if(d[i][j]<d[k][1])k+=200;
					else if(d[k][1]<=d[i][j] && d[i][j]<d[k][2])tmp+=d[k][0];
				}
				if(tmp>150)f=0;
				//cout<<tmp<<endl;
			}
		}
		
		if(f)cout<<"OK"<<endl;
		else cout<<"NG"<<endl;
	}
	
	
	return 0;
}
