import collections N = int(input()) C = collections.Counter() for _ in range(N): C[''.join(sorted(list(input()))+['a'])]+=1 for k,v in C.items(): if v==1: print(k) exit() print(-1)