Creating Fake News

Find one story vector satisfying n linear equations, then the minimum number of starting people whose reach covers all n people.

Hard9MathGraphDFSNo attempts yetTime limit2sMemory limit512 MB

Problem

A social network has nn people, numbered 1 to nn. One news story is described by dd real numbers c1,c2,,cdc_1, c_2, \dots, c_d, where cjc_j says how hard the story pushes topic jj. These numbers do not have to be integers.

Person ii comes with an interest vector ai1,ai2,,aida_{i1}, a_{i2}, \dots, a_{id} and a threshold tit_i. Person ii likes a story exactly when ai1c1+ai2c2++aidcd=tia_{i1}c_1 + a_{i2}c_2 + \dots + a_{id}c_d = t_i. A sum above the threshold is no better than a sum below it, so only an exact match works.

Someone who receives the story and likes it passes it on to everyone on their share list. Someone who does not like it passes it to nobody. You pick the people who receive the story first, and you may pick several, but every one of them gets the same single story.

Design one story that all nn people like. Such a story does not always exist, and you report that when it happens. When it does exist, report the smallest number of people you have to start the story at so that every person receives it.

Input

The first line holds the number of data sets KK. After it come KK data sets.

The first line of a data set holds the number of people nn and the number of topics dd. Each of the next nn lines describes one person: line ii holds the integers ai1,,aida_{i1}, \dots, a_{id}, then the threshold tit_i, then the size kik_i of the share list, then the kik_i numbers of the people person ii sends news to.

1K201 \le K \le 20, 1n1001 \le n \le 100, 1d201 \le d \le 20, aij100|a_{ij}| \le 100, ti1000|t_i| \le 1000, and 0kin10 \le k_i \le n - 1. The numbers on a share list are distinct and never include ii.

Output

For each data set, print Data Set x: on a line by itself, where xx is the number of the data set counting from 1. On the next line print the smallest number of people you have to start the story at so that everyone receives it, or Impossible when no story satisfies all nn people. Print a blank line after each data set.