#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;

const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-10;

int n;
int m[100], a[100], b[100];
int sum[200];

int main() {
	while (cin >> n, n) {
		REP(i, n) scanf("%d %d %d", m + i, a + i, b + i);
		
		vector<int> cx;
		REP(i, n) cx.push_back(a[i]);
		REP(i, n) cx.push_back(b[i]);
		
		sort(ALL(cx));
		cx.erase(unique(ALL(cx)), cx.end());
		
		REP(i, n) a[i] = lower_bound(ALL(cx), a[i]) - cx.begin();
		REP(i, n) b[i] = lower_bound(ALL(cx), b[i]) - cx.begin();
		
		memset(sum, 0, sizeof(sum));
		
		REP(i, n) {
			sum[a[i]] += m[i];
			sum[b[i]] -= m[i];
		}
		
		FOR(i, 1, 200) sum[i] += sum[i - 1];
		
		bool ans = true;
		REP(i, 200) if (sum[i] > 150) ans = false;
		puts(ans ? "OK" : "NG");
	}
	return 0;
}