#include <cstdio>
#include <cmath>
#include <cstring>
#include <vector>
#include <algorithm>
#define MaxN 310
#define SQR(v) ((v)*(v))
#define SZ(v) ((int)(v.size()))
using namespace std;

struct Pad
{
    double v;
    int x, y, r;
    void input() { scanf("%lf%d%d%d", &v, &x, &y, &r); }
    bool operator < (const Pad &a) const { return v < a.v; }
}p[MaxN];

vector <int> edge[MaxN];
bool dp[MaxN][MaxN];

double dist(int i, int j)
{
    return sqrt(SQR(p[i].x - p[j].x) + SQR(p[i].y - p[j].y));
}

int main()
{
    int T, n;
    scanf("%d", &T);
    while (T--)
    {
        scanf("%d", &n);
        for (int i = 0; i < n; ++i) p[i].input();
        sort(p, p + n);
        for (int i = 0; i < n; ++i)
        {
            edge[i].clear();
            for (int j = 0; j < n; ++j) if (dist(i, j) < p[i].r + p[j].r) edge[i].push_back(j);
        }
        memset(dp, 0, sizeof(dp));
        for (int i = 0; i < SZ(edge[0]); ++i) dp[0][edge[0][i]] = 1;
        for (int i = 0; i < n; ++i) for (int j = i + 1; j < n; ++j) if (dp[i][j])
        {
            for (int k = 0; k < SZ(edge[i]); ++k)
            {
                int ni = edge[i][k];
                if (ni < j) dp[ni][j] = 1;
                else if (ni > j) dp[j][ni] = 1;
            }
        }
        bool ans = 0;
        for (int i = 0; !ans && i < SZ(edge[n-1]); ++i) if (dp[edge[n-1][i]][n-1]) ans = 1;
        printf("Game is %s\n", ans ? "VALID" : "NOT VALID");
    }
    return 0;
}
