#include <map>
#include <set>
#include <list>
#include <cstdio>
#include <cmath>
#include <deque>
#include <stack>
#include <bitset>
#include <cctype>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

#define fr first
#define sc second
#define mp make_pair
#define foreach(c, it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)

typedef long long int64;
typedef pair< int, int > iP;
typedef pair< iP, int > iiP;

const int INF = 2 << 28;
const double EPS = 1e-10;

int main() {
    
    int n;
    while(cin >> n, n) {
        map< int, vector< int > > sum;
        for(int i = 0; i < n; i++) {
            int m, a, b; cin >> m >> a >> b;
            sum[a].push_back(m);
            sum[b].push_back(-m);
        }
    
        int now = 0, broken = 0;
        foreach(sum, it) {
            for(int i = 0 ; i < it->sc.size(); i++) {
                now += it->sc[i];
            }
            if(now > 150) {
                broken = 1;
                break;
            }
        }
        if(broken) cout << "NG" << endl;
        else cout << "OK" << endl;
    }
}