N = int(input()) dic = {} dic2 = {} abc = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] for i in range(N): S = list(input()) S.sort() nex = "".join(S) if nex in dic: dic[nex] += 1 else: dic[nex] = 1 for j in abc: nex2 = S + [j] nex2.sort() nex3 = "".join(nex2) if nex3 not in dic2: dic2[nex3] = 1 else: dic2[nex3] += 1 #print(dic) #print(dic2) for ind,val in dic.items(): if val == 1: for j in abc: nex2 = S + [j] nex2.sort() nex3 = "".join(nex2) if nex3 in dic2 and dic2[nex3] == 1: print(nex3) exit() print(-1)