
import std.stdio, std.container;

enum T {start, end};

struct User {
  int weight;
  long time;
  T type;
  long opCmp(ref User u) {return this.time - u.time;}
}

void main() {
  for(int t; readf("%d\n", &t), t != 0;) {
    User[] users;
    foreach(i; 0..t) {
      int weight;
      long s_time, e_time;
      readf("%d %d %d\n", &weight, &s_time, &e_time);
      users ~= User(weight, -s_time, T.start);
      users ~= User(weight, -e_time, T.end);
    }
    auto h = heapify(users);
    bool ans = true;
    int curr = 0;
    while(!h.empty) {
      User u = h.front;
      switch(u.type) {
      case T.start:
        curr += u.weight;
        if (curr > 150) {ans = false; break;}
        break;
      case T.end:
        curr -= u.weight;
        break;
      default:
        break;
      }
      h.removeFront;
    }
    writeln(ans ? "OK" : "NG");
  }
}