#嘘解法 I,R=input,range D={} for n in R(int(I())): S="".join(sorted(I())) if S in D:D[S]+=1 else:D[S]=1 for S in sorted(D): if D[S]<2:exit(print("a"+S)) print(-1)