from collections import defaultdict n = int(input()) s = [""] * n for i in range(n): s[i] = list(input()) cnt = defaultdict(int) for i in range(n): for c in range(26): t = s[i] + [chr(ord('a') + c)] t.sort() cnt["".join(t)] += 1 for t in cnt: if cnt[t] == 1: print("".join(t)) exit(0) print(-1)