/////16:35~
/////B:16:42
/////C:

#include<iostream>
#include<vector>
#include<algorithm>

int S[1010];
int k[1010];
int Nmax[10101];
int Nmin[10101];
using namespace std;
int main(){
    while(true){
        int N,M;
        cin>>N>>M;
        if(N==0)return 0;
        for(int i =0;i<=N;i++){
            Nmin[i]=0;
            Nmax[i]=0;
        }
        vector<vector<int> > c(M+1);
        for(int i = 1;i<=M;i++){
            cin>>S[i]>>k[i];
            for(int j=1;j<=k[i];j++){
                int tmp;
                cin>>tmp;
                c[i].push_back(tmp);
                Nmax[tmp]+=S[i];
            }
            if(k[i]==1){
                Nmin[c[i][0]]+=S[i];
            }
        }
        int min1=1e9,min2=1e9,ans=0,minpos=0;
        for(int i =1;i<=N;i++){
            if(Nmin[i]<=min1){
                min1 = Nmin[i];
                minpos = i;
            }
        }
        for(int i =1;i<=N;i++){
            if(Nmin[i]<=min2){
                if(i!=minpos){
                    min2 = Nmin[i];
                }
            }
        }
        for(int i =1;i<=N;i++){
            if(i == minpos){
                ans = max(ans,Nmax[i]-min2);
            }else{
                ans = max(ans,Nmax[i]-min1);
            }
        }
        cout<<ans+1<<endl;
    }
    return 0;
}
