ll@N;mapa;string S;rep(N){rd(S);VI H(26),h;rep(i,S.size())H[S[i]-97]++;rep(i,26)h=H,h[i]++,a[h]++;}auto j=a.begin(),e=a.end();for(;j!=e;j++)if(j->second<2){S="";char c;rep(i,26)REP(j->first[i])S+=c=i+97;wt(S);exit(0);}wt(-1);