#include <bits/stdc++.h>

using namespace std;

int main()
{
    int t,n,i,n1,p;
    cin>>t;
    for (i=0;i<t;i++){
        cin>>n;
        while (cin>>n){
            n1=n%10;
            p*=n1;
            break;
        }
        }
    <vector> <int> v(p);
    v.erase(unique(v.begin(),v.end()),v.end());
    return 0;
}