N=int(input()) S=[] for i in range(N): s=input(); res=[] for j in range(len(s)): res.append(s[j]) S.append(tuple(sorted(res))) from collections import defaultdict dd=defaultdict(lambda: 0) for elm in S: dd[elm]+=1 new_s=set() for key in dd: if dd[key]!=1: continue new_s.add(key) S=new_s if len(S)==0: print(-1) for tup1 in S: flag=True for tup2 in S: if tup1==tup2: continue if len(tup1)!=len(tup2): continue diff=0 j=0 for i in range(len(tup1)): if j>len(tup2): continue if tup1[i]!=tup2[j]: diff+=1; j+=1 if diff<=1: flag=False if flag: ans=list(tup1) ans.append("a") print("".join(sorted(ans))) exit()