#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cassert>
#include<ctime>
using namespace std;

#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)
#define absd(x) (x<0?-(x):x)
#define pow2(x) ((x)*(x))
#define rep(i,n) for(int i=0; i<n; ++i)
#define repr(i,n) for(int i=n-1; i>=0; --i)
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define replr(i,s,n) for(int i=n; i>=s; --i)
#define repf(i,s,n,j) for(int i=s; i<=n; i+=j)
#define repe(e,obj) for(auto e : obj)

#define SP << " " <<
#define COL << " : " <<
#define COM << ", " <<
#define ARR << " -> " <<
#define PNT(STR) cout << STR << endl
#define POS(X,Y) "(" << X << ", " << Y << ")"
#define DEB(A) " (" << #A << ") " << A
#define DEBREP(i,n,val) for(int i=0; i<n; ++i) cout << val << " "; cout << endl
#define ALL(V) (V).begin(), (V).end()
#define INF 1000000007
#define INFLL 1000000000000000007LL
#define EPS 1e-9

typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define P_TYPE int
typedef pair<P_TYPE, P_TYPE> P;
typedef pair<P, P_TYPE> PI;
typedef pair<P_TYPE, P> IP;
typedef pair<P, P> PP;
typedef priority_queue<P, vector<P>, greater<P> > pvqueue;

#define N 10003
int mi[N], ma[N];
int main() {
  int n, m;
  while(cin >> n >> m && n+m) {
    rep(i, n) mi[i] = ma[i] = 0;
    rep(i, m) {
      int s, k;
      cin >> s >> k;
      if(k == 1) {
        int c; cin >> c;
        mi[c-1]+=s; ma[c-1] += s;
      } else {
        rep(j, k) {
          int c;
          cin >> c;
          ma[c-1] += s;
        }
      }
    }
    int is1, it1, is2, it2, tmps, tmpt;
    tmps = 1000000007;
    tmpt = 0;
    rep(i, n) {
      if(tmpt < ma[i]) {tmpt = ma[i]; it1 = i;}
      if(mi[i] < tmps) {tmps = mi[i]; is2 = i;}
    }
    tmps = 1000000007;
    tmpt = 0;
    rep(i, n) {
      if(i != it1 && mi[i] < tmps) {tmps = mi[i]; is1 = i;}
      if(i != is2 && tmpt < ma[i]) {tmpt = ma[i]; it2 = i;}
    }
    cout << maxd(ma[it1] - mi[is1], ma[it2] - mi[is2])+1 << endl;
  }
  return 0;
}