N=int(input())
mstr='qwertyuiopasdfghjklzxvcbnmA'
len_mstr=2147483647
for i in range(N):
s=''
n=input()
for j in n:
if j not in s:
s+=j
if len(s)<len_mstr:
len_mstr=len(s)
mstr=n
elif len(s)==len_mstr:
if n<mstr:
len_mstr=len(s)
mstr=n
print(mstr)