def oi(): return int(input()) def os(): return input().rstrip() def mi(): return list(map(int, input().split())) # import sys # input = sys.stdin.readline # import sys # sys.setrecursionlimit(10**8) # import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') from collections import defaultdict input_count = 0 N = oi() out = set([]) dicts = defaultdict(int) for _ in range(N): S = "".join(sorted(list(os()))) dicts[S] += 1 alpha = [chr(ord("a")+i) for i in range(26)] output = "-1" flg = False for o in out: if dicts[o]!=1: continue for a in alpha: if o+a not in out: output = o+a flg=True break if flg: break print(output)