#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int main(){
    int n,m;
    while(cin >> n >> m &&n!=0){
        vector<int> a(n);
        vector<int> b(n);
        rep(i,m){
            int s;
            cin >> s;
            int k;
            cin >> k;
            rep(j,k){
                int c;
                cin >> c;
                c--;
                if(k==1){
                    b[c] += s;
                }else{
                    a[c] += s;
                }
            }
        }
        vector<pair<int,int> > A,B;
        rep(i,n){
            A.push_back(make_pair(a[i]+b[i],i));
            B.push_back(make_pair(b[i],i));
        }
        sort(B.begin(),B.end());
        sort(A.rbegin(),A.rend());
        int res = 0;
        rep(i,2){
            rep(j,2){
                if(A[i].second!=B[j].second){
                    res = max(res,A[i].first-B[j].first);
                }
            }
        }
        cout << res+1 << "\n";
    }
    return 0;
}
