#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

// #define DEBUG_MODE
#ifdef DEBUG_MODE
#define dump(x) cout << #x << " : " << x << endl
#define LINE cout << "line : " << __LINE__ << endl
#define dumpV(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << endl
#define STOP assert(false)
#else
#define dump(x) ;
#define LINE 	;
#define dumpV(v);
#define STOP 	;
#endif
#define mp make_pair

namespace std {
template<class S, class T>
ostream &operator <<(ostream& out, const pair<S, T>& a) {
	out << '(' << a.fi << ", " << a.se << ')';
	return out;
}
}


int main() {
	int n, m;
	while (cin >> n >> m) {
		if (n == 0 && m == 0) break;
		vi s(m), v(n), u(n);
		rep(i, m) {
			int k, a;
			cin >> s[i] >> k;
			rep(j, k) {
				cin >> a;
				v[a - 1] += s[i];
				if (k == 1) u[a - 1] += s[i];
			}
		}
		vi idxV(n), idxU(n);
		rep(i, n) idxV[i] = idxU[i] = i;
		sort(all(idxV), [&](int a, int b) {return v[a] < v[b];});
		sort(all(idxU), [&](int a, int b) {return u[a] < u[b];});
		int ans = 0;
		if (idxV[n - 1] != idxU[0]) ans = max(ans, v[idxV[n - 1]] - u[idxU[0]]);
		else ans = max(ans, v[idxV[n - 1]] - u[idxU[1]]);
		if (idxV[n - 2] != idxU[0]) ans = max(ans, v[idxV[n - 2]] - u[idxU[0]]);
		else ans = max(ans, v[idxV[n - 2]] - u[idxU[1]]);
		cout << ans+1 << endl;
		dumpV(v);
		dumpV(u);
	}
	return 0;
}