#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 99999999



int main(){
    int n,a,b,c;
    while(cin>>n&&n){
        vector<pii> v;
        rep(i,n){
            cin>>a>>b>>c;
            v.pb(pii(b,a ));
            v.pb(pii(c,-a));
        }
        sort(all(v));
        int sum=0;
        bool f=false;
        rep(i,v.size()){
            sum+=v[i].second;
            if(sum>150){
                f=true;
                break;
            }
        }
        if(f)cout<<"NG"<<endl;
        else cout<<"OK"<<endl;
    }
}