#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 24;
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

typedef unsigned long long ull;
typedef std::pair<int,int> P;

int N;
std::vector<int> S, T, W;

int compress(std::vector<int> &v1, std::vector<int> &v2){
    std::vector<int> v;
    REP(i, N){
        v.push_back(v1[i]);
        v.push_back(v2[i]);
    }

    std::sort(v.begin(), v.end());
    v.erase(std::unique(v.begin(), v.end()), v.end());
    
    REP(i, N){
        v1[i] = std::lower_bound(v.begin(), v.end(), v1[i]) - v.begin();
        v2[i] = std::lower_bound(v.begin(), v.end(), v2[i]) - v.begin();
    }
    
    return v.size();
}

int main(){
    while(std::cin >> N, N){
        S.clear(); T.clear(); W.clear();
        REP(i, N){
            int m, a, b;
            std::cin >> m >> a >> b;
            W.push_back(m);
            S.push_back(a);
            T.push_back(b);
        }

        int w = compress(S, T);
        int ts[200];
        std::fill(ts, ts+200, 0);
        REP(i, N){
            int s = S[i], t = T[i];
            FOR(j, s, t){
                ts[j] += W[i];
            }
        }

        bool dame = false;
        REP(i, w){
            if(ts[i] > 150){
                dame = true;
            }
        }

        if(!dame){
            std::cout << "OK" << std::endl;
        }else{
            std::cout << "NG" << std::endl;
        }
    }
}