import sys input = sys.stdin.readline from collections import * def strsort(s): s = sorted(s) return "".join(s) N = int(input()) D = defaultdict(int) S = [None] * N for i in range(N): S[i] = input().rstrip() S[i] = strsort(S[i]) for k in range(26): temp = S[i] + chr(ord("a") + k) temp = strsort(temp) D[temp] += 1 for i in range(N): for k in range(26): temp = S[i] + chr(ord("a") + k) temp = strsort(temp) if D[temp] == 1: print(temp) exit() print(-1)