#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == 0)
            return 0;

        vector<pair<int, int> > t(n*2);
        for(int i=0; i<n; ++i){
            int m, a, b;
            cin >> m >> a >> b;
            t[i*2] = make_pair(a, m);
            t[i*2+1] = make_pair(b, -m);
        }
        sort(t.begin(), t.end());

        int w = 0;
        bool ret = true;
        for(int i=0; i<2*n; ++i){
            w += t[i].second;
            if(w > 150)
                ret = false;
        }
        if(ret)
            cout << "OK" << endl;
        else
            cout << "NG" << endl;
    }
}