Translation
Quiz
You are a director of a quiz show. There are N participants scheduled to appear as answerers in the quiz show, each of whom is numbered from 1 to N.
The quiz plans to ask M+1 questions, each of which is numbered from 1 to M+1. The questions are asked in order of their numbers, and only the first person to answer correctly by pressing the buzzer will get the points. The score of the i-th question is an integer Si. The person with the highest total score at the end of the M+1-th question will win. However, if there are multiple persons with the highest score, no one will win.
You have decided the scores for the first M questions and are now considering the score for the last question, which is usually set to a score that anyone can turn around. However, if the score for the last question is determined based on the participants' total scores at that time, it may discourage the participants from doing their best. Therefore, you have decided to set the score for the last question in advance so that all participants will have a chance to turn the game around no matter what the score situation may be.
Fortunately, it is known which participants can answer correctly for questions 1 to M. For the M+1-th question, all participants can answer correctly. Only one person among those who can answer correctly will get the score Si for the M+1-th question. The answer to the question is closed as soon as the answerer who answered correctly appears, and the same answerer can answer the question as many times as he or she wants. Therefore, you do not need to consider the score Si of the question if no one can get it. Also, multiple answerers will not share the score Si of a question that they answered correctly or share the score.
Given the information about the scores for each question and the participants who can answer correctly, find the minimum score SM+1 for the last question so that anyone can win the game by answering correctly regardless of the score situation.
Input
The input consists of multiple datasets, each in the following format.
N M
S1 k1 c1,1 ... c1,k1
...
SM kM cM,1 ... cM,kM
The first line contains two integers N and M, the number of answerers and the number of questions except the last one.
For questions 1 to M, information about the participants who can answer correctly is given. The i-th line contains the score Si for the i-th question, the number of participants ki who can answer the question correctly, and the numbers ci,1 ... ci,ki of the participants who can answer the question.
The end of the input is indicated by a line containing two zeros. The number of datasets does not exceed 30.
All integers in the input are positive integers that satisfy the following conditions.
2 ≤ N ≤ 10,000
1 ≤ M ≤ 1,000
1 ≤ Si ≤ 100
1 ≤ ki ≤ N
1 ≤ ci,1 < ... < ci,ki ≤ N
Σki  ≤  100,000
Note that the output value of SM+1 may exceed this range.
Output
For each dataset, output the minimum value of SM+1 that satisfies the above condition in one line.
Sample Input
3 2
5 2 1 3
8 2 2 3
2 3
8 2 1 2
3 1 1