#include<iostream>
#include<vector>
#include<string>
using namespace std;
#define pb push_back

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        vector<string> dirn, roads;
        for(int i=0;i<n;i++)
        {
            string rt_lft, on, name;
            cin>>rt_lft>>on;

            getline(cin,name);
            
        }

    }
}