include[HTML_REMOVED]
using namespace std;
const int N=101;
bool s[N];
int f[N]={0};
int t[N]={0};
int main(){
int n,m;
cin>>n>>m;
while(n–){
int x;
cin>>x;
int a[101];
for(int i=1;i<=x;i){
cin>>a[i];
s[a[i]]=true;
t[a[i]];
}
for(int i=1;i<=m;i)
if(s[i]==true)f[i];
for(int i=1;i<=m;i)
s[i]=false;
}
for(int i=1;i<=m;i){
cout<<f[i]<<” “<<t[i];
cout<<endl;
}
}