#include<stdio.h>
#define REP(i,n) for (int i = 0 ; i < (int)n ; i++)
typedef long long ll;

int main(){
    int n,k,d,j,count=0;
    scanf("%d %d",&n,&k);
    int sunuke[n];
    REP(i,n){
        sunuke[i] = 0;
    }
    REP(i,k){
        scanf("%d",&d);
        REP(i,d){
            scanf("%d",&j);
            sunuke[j-1] += 1;
        }
    }
    REP(i,n){
        printf("%d個\n",sunuke[i]);
        if(!sunuke[i]){
            count += 1;
        }
    }
    printf("%d\n",count);
}