#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
using namespace std;

struct Info_max{
	Info_max(int arg_point,int arg_id){
		point = arg_point;
		id = arg_id;
	}
	bool operator<(const struct Info_max &arg) const{
			return point < arg.point;
	};
	int point,id;
};

struct Info_min{
	Info_min(int arg_point,int arg_id){
		point = arg_point;
		id = arg_id;
	}
	bool operator<(const struct Info_min &arg) const{
			return point > arg.point;
	};
	int point,id;
};

 int main(){

	 int N,M,max_points[10001],point,num,tmp,forced_points[10001],maximum,minimum;
	 priority_queue<Info_max> MAX;
	 priority_queue<Info_min> MIN;
	 while(true){
		 scanf("%d %d",&N,&M);
		 if(N == 0 && M == 0)break;

		 for(int i = 1; i <= N; i++){
			 max_points[i] = 0;
			 forced_points[i] = 0;
		 }

		 for(int loop = 0; loop < M; loop++){
			 scanf("%d %d",&point,&num);
			 if(num == 1){
				 scanf("%d",&tmp);
				 forced_points[tmp] += point;
				 max_points[tmp] += point;
			 }else{ //num > 1
				 for(int i = 0; i < num; i++){
					 scanf("%d",&tmp);
					 max_points[tmp] += point;
				 }
			 }
		 }

		 while(!MAX.empty())MAX.pop();
		 while(!MIN.empty())MIN.pop();

		 for(int i = 1; i <= N; i++){
			 MAX.push(Info_max(max_points[i],i));
			 MIN.push(Info_min(forced_points[i],i));
		 }

		 if(MAX.top().id != MIN.top().id){
			 printf("%d\n",MAX.top().point-MIN.top().point+1);
		 }else{
			 maximum = MAX.top().point;
			 MAX.pop();
			 minimum = MIN.top().point;
			 MIN.pop();
			 printf("%d\n",max(maximum-MIN.top().point,MAX.top().point-minimum)+1);
		 }
	 }

	 return 0;
}