#include <iostream>
#include <algorithm>
#include <utility>

int n;
std::pair<unsigned int, int> arr[210];

int main() {
    while(std::cin >> n, n) {
        int m, a, b;
        for(int i = 0; i < n; ++i) {
            std::cin >> m >> a >> b;

            arr[i * 2] = std::make_pair(a, m);
            arr[i * 2 + 1] = std::make_pair(b, -m);
        }

        std::sort(arr, arr + n * 2);

        int w = 0;
        bool ok = true;
        for(int i = 0; i < n * 2; ++i) {
            w += arr[i].second;

            if(w > 150) {
                ok = false;
                break;
            }
        }

        std::cout << (ok ? "OK" : "NG") << std::endl;
    }
}