#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef pair<int, int> P;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
bool solve(priority_queue<P, vector<P>, greater<P> > q) {
  int weight = 0;
  while (!q.empty()) {
    P p = q.top(); q.pop();
    weight += p.second;
    if (weight > 150) return false;
  }
  return true;
}

int main() {
  int n;
  while (cin >> n and n) {
    priority_queue<P, vector<P>, greater<P> > q;
    REP(i, n) {
      int m, a, b;
      cin >> m >> a >> b;
      q.push(P(a, m));
      q.push(P(b, -m));
    }

    cout << (solve(q) ? "OK" : "NG") << endl;
  }
}