#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#define REP(i, n) for(long long i = 0; i < n; ++i)
#define ALL(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

int main() {
	while(1) {
		int n, m;
		cin>>n>>m;
		if(n==0&&m==0) break;
		vector<int> mini(n, 0);
		vector<int> maxi(n, 0);
		REP(i, m) {
			int s, k;
			cin>>s>>k;
			REP(j, k) {
				int c;
				cin>>c;
				--c;
				if(k == 1) mini[c] += s;
				maxi[c] += s;
			}
		}
		int res = 0;
		REP(i, n) {
			REP(j, n) {
				if(i == j) continue;
				res = max(res, maxi[i] - mini[j]);
			}
		}
		cout<<res + 1<<endl;
	}
}