#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef long long ll;

int main(void){
    while (1) {
        ll n, m;
        cin >> n >> m;
        if (n == 0 && m == 0) return 0;
        
        ll dc[10010], my[10010];
        for (int i = 0; i < n; i++) {
            dc[i] = 0;  my[i] = 0;
        }
        
        for (int i = 0; i < m; i++) {
            ll s, k;
            cin >> s >> k;
            for (int i = 0; i < k; i++) {
                ll c;
                cin >> c;
                c--;
                if (k == 1) dc[c] += s;
                else my[c] += s;
            }
        }
        
        vector<pair<ll, ll> > sm, sm2;
        for (int i = 0; i < n; i++) {
            sm.emplace_back(dc[i] + my[i], i);
            sm2.emplace_back(dc[i], i);
        }
        
        sort(sm.begin(), sm.end());
        sort(sm2.begin(), sm2.end());
        
        //for (int i = 0; i < n; i++) cout << sm[i].first << " " << sm[i].second << endl;
        //for (int i = 0; i < n; i++) cout << sm2[i].first << " " << sm2[i].second << endl;
        
        if (sm[n - 1].second != sm2[0].second) cout << sm[n - 1].first - sm2[0].first + 1 << endl;
        else {
            cout << max(sm[n - 2].first - sm2[0].first, sm[n - 1].first - sm2[1].first) + 1 << endl;;
        }
        
        
    }
}

