#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>

#define rep(i, a) REP(i, 0, a)
#define REP(i, a, b) for(int i = a; i < b; ++i)
#define repll(i, a) REPLL(i, 0, a)
#define REPLL(i, a, b) for(ll i = a; i < b; ++i)

typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int, int> P;
typedef std::pair<P, int> PP;
const double PI = 3.14159265358979323846;
const double esp = 1e-9;
const int infi = (int)1e+9 + 10;
const ll infll = (ll)1e+17 + 10;

int n;
std::map<int, int> ind;
int dat[101], s[101], e[101];
int calc[105];

int main(){
	while (std::cin >> n, n){
		ind.clear();
		memset(dat, 0, sizeof(dat));
		memset(s, 0, sizeof(s));
		memset(e, 0, sizeof(e));
		memset(calc, 0, sizeof(calc));
		rep(i, n){
			std::cin >> dat[i] >> s[i] >> e[i];
			ind[s[i]] = 0;
			ind[e[i]] = 0;
		}

		int cnt = 0;
		for (auto it = ind.begin(); it != ind.end(); ++it){
			it->second = cnt;
			++cnt;
		}

		rep(i, n){
			calc[ind[s[i]]] += dat[i];
			calc[ind[e[i]]] -= dat[i];
		}

		bool flg = true;
		rep(i, ind.size()){
			if (i != 0)calc[i] += calc[i - 1];
			if (calc[i] > 150)flg = false;
		}
		std::cout << (flg ? "OK" : "NG") << std::endl;
	}
	return 0;
}