#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = (1e+9) + 7;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-4;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int n, m;
ll a[1 << 14], b[1 << 14];
int main() {
	while (cin >> n >> m, n) {
		rep(i, n) {
			a[i] = b[i] = 0;
		}
		rep(i, m) {
			ll s; cin >> s; int k; cin >> k;
			rep(j, k) {
				int c; cin >> c; c--;
				a[c] += s;
				if (k == 1) {
					b[c] += s;
				}
			}
		}
		ll ma = 0; int id;
		ll mi = INF; int chk;
		rep(i, n) {
			if (ma < a[i]) {
				ma = a[i]; id = i;
			}
			if (mi > b[i]) {
				mi = b[i]; chk = i;
			}
		}
		ll out = 0;
		if (id != chk) {
			out = ma - mi + 1;
		}
		else {
			ll ma2 = 0,mi2 = INF;
			rep(i, n) {
				if (i != id) {
					ma2 = max(ma2, a[i]);
				}
				if (i != chk) {
					mi2 = min(mi2, b[i]);
				}
			}
			out = max(ma2 - mi+1, ma - mi2+1);
		}
		cout << out << endl;
	}
	return 0;
}

