#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
    int n, m;
    while (cin >> n >> m, n + m) {
        vector<int> pmax(n, 0), pmin(n, 0);
        for (int i = 0; i < m; i++) {
            int s, k, c; cin >> s >> k;
            for (int j = 0; j < k; j++) {
                cin >> c; c--;
                pmax[c] += s;
            }
            if (k == 1) pmin[c] += s;
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j) continue;
                ans = max(ans, pmax[i] - pmin[j]);
            }
        }
        cout << ans + 1 << endl;
    }
}

