Fired

No attempts yetTime limit1sMemory limit256 MB

Problem

Charlie is the head of HR at a large company. Every employee except the CEO reports to one or more people. Nobody reports to themselves, directly or indirectly.

This year's budget arrived and the salary line was cut by CC dollars. Charlie does not like firing people, so he wrote a program that automatically fires any employee left with nobody to report to. The program repeats until no employee other than the CEO is without a manager. It never fires the CEO automatically, even though the CEO reports to nobody.

Charlie will fire exactly one person by hand and let the program handle the rest. The total salary of everyone fired has to be at least CC dollars, and among the choices that reach CC it has to be as close to CC as possible. If several employees produce the same total, pick the one with the largest employee number. A CEO can be incompetent too, so Charlie may fire the CEO.

Input

The first line contains one integer TT, the number of test cases.

Each test case begins with a line containing two integers NN and CC, the number of employees and the amount to save.

The next NN lines describe employees 00 through N1N-1 in order. The line for employee ii starts with the salary SiS_i and the number of people RiR_i that employee ii reports to, followed by RiR_i numbers EijE_{ij}, the employee numbers of those people.

  • 1T1001 \le T \le 100
  • 1N2001 \le N \le 200
  • 1CiSi1 \le C \le \sum_i S_i
  • 1Si1000001 \le S_i \le 100000
  • 0Ri<N0 \le R_i < N, and exactly one employee has Ri=0R_i = 0.
  • 0Eij<N0 \le E_{ij} < N

Output

For each test case, print on its own line the employee number of the person Charlie should fire.