#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, m;
  while (cin >> n >> m) {
    if (n == 0) break;
    vector<int> mx(n, 0), mn(n, 0);
    for (int i = 0; i < m; i++) {
      int s, k;
      cin >> s >> k;
      for (int j = 0; j < k; j++) {
        int c;
        cin >> c, c--;
        if (k == 1) mn[c] += s;
        mx[c] += s;
      }
    }

    pair<int, int> pmx(-1, -1), pmn(-1, 1e9);
    for (int i = 0; i < n; i++) {
      if (mx[i] > pmx.second) pmx = {i, mx[i]};
      if (mn[i] < pmn.second) pmn = {i, mn[i]};
    }
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (i != pmx.first) ans = max(ans, mx[pmx.first] - mn[i]);
      if (i != pmn.first) ans = max(ans, mx[i] - mn[pmn.first]);
    }

    cout << ans + 1 << endl;
  }
}

