#include <bits/stdc++.h>
#define int long long
#define INF 1e+18
using namespace std;

bool ok[10000][1000];

signed main(){
	int n,m;
	while(cin >> n >> m,n){
		int s[1000],ans = 0,point[10000] = {};
		for(int i = 0;i < n;i++){
			for(int j = 0;j < m;j++) ok[i][j] = false;
		}
		for(int i = 0;i < m;i++){
			int k;
			cin >> s[i] >> k;
			for(int j = 0;j < k;j++){
				int c;
				cin >> c; c--;
				if(k == 1){
					point[c] += s[i];
					s[i] = 0;
				}
				ok[c][i] = true;
			}
		}
		for(int i = 0;i < n;i++){
			int score = point[i],mi = INF;
			for(int j = 0;j < n;j++){
				if(i != j) mi = min(mi,point[j]);
			}
			for(int j = 0;j < m;j++){
				if(ok[i][j]) score += s[j];
			}
			ans = max(ans,score - mi);
		}
		cout << ans + 1 << endl;
	}
}
