#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

struct Quiz{
  int score;
  std::vector<int> solver;
};

int Solve(int n,int m){
  std::vector<Quiz> quiz(m);
  for(int i=0;i<m;i++){
    Quiz nextquiz;
    int s,k;
    cin>>s>>k;
    nextquiz.score=s;
    for(int j=0;j<k;j++){
      int num;
      cin>>num;
      nextquiz.solver.push_back(num);
    }
    quiz[i]=nextquiz;
  }

  int max_score[10001]={},min_score[10001]={};
  for(auto q:quiz){
    for(auto s:q.solver) {
      max_score[s] += q.score;
      if (q.solver.size() == 1) {
        min_score[s] += q.score;
      }
    }
  }

  int result=0;
  for(int i=1;i<=n;i++){
    for(int j=1;j<=n;j++){
      if(i==j) continue;
      result=std::max(result,max_score[i]-min_score[j]+1);
    }
  }
  return result;

}

int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);

  while(1){
    int n,m;
    cin>>n>>m;
    if(n==0&&m==0){
      break;
    }
    cout<<Solve(n,m)<<endl;
  }

  return 0;
}

