#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

vector < pair <int, int> > data;

int main(void)
{
	int n, m, a, b;
	while (cin >> n, n){
		data.clear();
		for (int i = 0; i < n; i++){
			scanf("%d %d %d", &m, &a, &b);
			data.push_back(make_pair(a, m));
			data.push_back(make_pair(b, -1 * m));
		}
		sort(data.begin(), data.end());
		
		long long now = 0;
		bool flag = true;
		for (int i = 0; i < data.size(); i++){
			now += data[i].second;
			//cout << now << endl;
			if (150 < now) flag = false;
		}
		if (flag) cout << "OK" << endl;
		else cout << "NG" << endl;
	}
	
	return 0;
}