# Arup Guha
# 4/29/2025
# Solution to 2025 COP 4516 Team Contest Problem: Rhinoceros Count

nC = int(input())

# Go through cases 1-based.
for loop in range(1, nC+1):

    # Case header.
    print("Case ",loop,":", sep="")
    
    days = int(input())

    # Will used one based indexing and 1-based days.
    lastseen = []
    for i in range(187):
        lastseen.append(0)

    # Loop through the days.
    for d in range(1, days+1):

        # Go through each ranger.
        numR = int(input())
        for i in range(numR):

            # Get list, remove counter for # of rhinos.
            rhinos = [int(x) for x in input().split()]
            rhinos = rhinos[1:]

            # Mark each one of these as seen on day d.
            for x in rhinos:
                lastseen[x] = d

        # Go through these in order, output accordingly.
        for i in range(1, 187):
            if d - lastseen[i] >= 10:
                print("Day ",d+1,": Full Search ",i,sep="")
            elif d - lastseen[i] >= 4:
                print("Day ",d+1,": Extra Ranger ",i,sep="")
