#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--)

int n;

int main()
{
	while (cin >> n, n){
		vector<pair<int, int> > v;
		rep(i, n){
			int m, a, b;
			cin >> m >> a >> b;
			v.push_back(make_pair(a, m));
			v.push_back(make_pair(b, -m));
		}
		sort(v.begin(), v.end());
		bool res = true;
		int s = 0;
		rep(i, n * 2){
			s += v[i].second;
			if (s > 150) res = false;
		}
		cout << (res ? "OK" : "NG") << endl;
	}
}