#include<iostream>
#include<vector>
#include<algorithm>
#define MAX 150

using namespace std;

struct DATA{
  int time;
  int log;
};

bool IsSafety(vector<DATA>);
bool Compare(const DATA&, const DATA&);

int main(){
  int i, n, m, a, b;
  DATA _data;
  vector<DATA> data;

  while(1){
    cin >> n;
    if(n == 0) break;

    for(i=0; i<n; ++i){
      cin >> m >> a >> b;
      _data.time = a;
      _data.log = m;
      data.push_back(_data);
      _data.time = b;
      _data.log = -m;
      data.push_back(_data);
    }

    sort(data.begin(), data.end(), Compare);

    if(IsSafety(data)) cout << "OK" << endl;
    else cout << "NG" << endl;

    data.clear();
  }
  return 0;
}

bool IsSafety(vector<DATA> data){
  int i, sum;
  for(i=0, sum=0; i<data.size(); ++i){
    sum += data[i].log;
    if(sum > MAX) return false;
  }
  return true;
}

bool Compare(const DATA& x, const DATA& y){
  if(x.time == y.time)
    return x.log < y.log; 
  else
    return x.time < y.time;
}