#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
using namespace std;

int main(){
	int n, m, a, b;
	while(cin >> n, n) {
		vector<pair<int, int> > v;
		rep(i,n) {
			pair<int, int> p;
			cin >> m >> a >> b;
			p.first = a, p.second = m;
			v.push_back(p);
			p.first = b, p.second = -m;
			v.push_back(p);
		}
		sort(v.begin(), v.end());
		bool f = 0;
		int cur = 0, w = 0;
		rep(i,v.size()) {
			while(1) {
				cur =v[i].first, w +=v[i].second;
				if(i == v.size()-1 || v[i].first != v[i+1].first) break;
				i++;
			}
			if(w>150) {
				f = 1;
				break;
			}
		}
		if(f) cout << "NG" << endl;
		else cout << "OK" << endl;
	}
}