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

using namespace std;

using Pii = pair<int, int>;

int solve(int n, int q) {
    vector<Pii> max_points(n, {0, 0}), min_points(n, {0, 0});
    for(int i=0;i<n;++i) {
        max_points[i].second = i;
        min_points[i].second = i;
    }
    int s, k, player;
    for(int i=0;i<q;++i) {
        cin >> s >> k;
        for(int j=0;j<k;++j) {
            cin >> player;
            max_points[player-1].first += s;
            if(k == 1) min_points[player-1].first += s;
        }
    }

    sort(max_points.rbegin(), max_points.rend());
    sort(min_points.begin(), min_points.end());
    if(max_points[0].second != min_points[0].second) {
        return max_points[0].first+1-min_points[0].first;
    }
    int ret1 = max_points[1].first+1-min_points[0].first;
    int ret2 = max_points[0].first+1-min_points[1].first;
    return max(ret1, ret2);
    
}

int main() {
    int n,m;
    while(cin >> n >> m && n) {
        cout << solve(n, m) << endl;
    }
}
