from collections import Counter

n=int(eval(input()))

s=[eval(input()) for i in range(n)]

c1=Counter(s.pop())



for ss in s:

    c2=Counter(ss)

    for k in list(c1.keys()):

        c1[k]=min(c1[k],c2[k])



ans=''

for k,v in sorted(c1.items()):

    ans+=k*v

print(ans)





n=int(eval(input()))

s=[eval(input()) for i in range(n)]

cnt=[0]*26

t=[0]*26

for i,ss in enumerate(s):

  t=[0]*26

  if i==0:

    for sss in ss:

      cnt[ord(sss)-97]+=1

    continue

  for sss in ss:

    t[ord(sss)-97]+=1

  for i in range(26):

    if cnt[i]>t[i]:

      cnt[i]=t[i]

ans=""

for i in range(26):

  ans+=chr(i+97)*cnt[i]

print(ans)



from collections import Counter

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
c1 = Counter(s.pop())
for ss in s:
    c2 = Counter(ss)
    for k in list(c1.keys()):
        c1[k] = min(c1[k], c2[k])
ans = ""
for k, v in sorted(c1.items()):
    ans += k * v
print(ans)

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
cnt = [0] * 26
t = [0] * 26
for i, ss in enumerate(s):
    t = [0] * 26
    if i == 0:
        for sss in ss:
            cnt[ord(sss) - 97] += 1
        continue
    for sss in ss:
        t[ord(sss) - 97] += 1
    for i in range(26):
        if cnt[i] > t[i]:
            cnt[i] = t[i]
ans = ""
for i in range(26):
    ans += chr(i + 97) * cnt[i]
print(ans)

-from collections import Counter - -c1 = Counter(s.pop()) -for ss in s: -    c2 = Counter(ss) -    for k in list(c1.keys()): -        c1[k] = min(c1[k], c2[k]) +cnt = [0] * 26 +t = [0] * 26 +for i, ss in enumerate(s): +    t = [0] * 26 +    if i == 0: +        for sss in ss: +            cnt[ord(sss) - 97] += 1 +        continue +    for sss in ss: +        t[ord(sss) - 97] += 1 +    for i in range(26): +        if cnt[i] > t[i]: +            cnt[i] = t[i] -for k, v in sorted(c1.items()): -    ans += k * v +for i in range(26): +    ans += chr(i + 97) * cnt[i]