from collections import Counter N = int(input()) S = [''.join(sorted(input())) for _ in range(N)] if N == 1: print(S[0] + 'z') exit() for key, val in Counter(S).items(): if val == 1: print(key + 'z') exit() print(-1)