#include <bits/stdc++.h>
using namespace std;
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG true
// sort(a.begin(), a.end(), std::greater<int>());

/*
std::vector<std::string> split(const std::string &input, char delimiter)
{
    std::istringstream stream(input);

    std::string field;
    std::vector<std::string> result;
    while (std::getline(stream, field, delimiter))
    {
        result.push_back(field);
    }
    return result;
}
*/

int main()
{
    int n, m;
    while (cin >> n >> m)
    {
        if (n == 0 && m == 0)
            break;
        vector<int> mx(n + 1);
        vector<int> mn(n + 1);
        int a, b;
        rep(j, m)
        {
            cin >> a >> b;

            rep(i, b)
            {
                int temp;
                cin >> temp;
                if (b == 1)
                    mn[temp] += a;
                mx[temp] += a;
            }
        }
        int hoge = 0;
        int hogeposi = 0;
        int piyo = INT_MAX;
        int piyoposi = 0;
        REP(i,1, mx.size())
        {
            if (hoge < mx[i])
            {
                hoge = mx[i];
                hogeposi = i;
            }
        }
        REP(i,1, mn.size())
        {
            if (piyo > mn[i] && i != hogeposi)
            {
                piyo = mn[i];
                piyoposi = i;
            }
        }
        cout << hoge-piyo + 1 << endl;
    }
    return 0;
}