import collections



n = int(eval(input()))

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

if n == 1:

    print(("".join(sorted(s[0]))))

else:

    c = []

    for i in s:

        c.append(collections.Counter(i))

    a = c[0]

    for i in range(1, n):

        a &= c[i]

    ans = []

    a = a.most_common()

    

    for i in a:

        for j in range(i[1]):

            ans.append(i[0])

    print(("".join(sorted(ans))))
n = int(eval(input()))



ss = []

mins = 'a'*100

for _ in range(n):

  s = str(''.join(sorted(eval(input()))))

  ss.append(s)

  if len(mins) > len(s):

    mins = s

  

ans = ''

for w in mins:

  ok = True

  for i, s in enumerate(ss[:]):

    if w in s:

      wi = s.find(w)

      ss[i] = s[:wi] + s[wi+1:]

    else:

      ok = False

  if ok:

    ans += w

print(ans)
import collections

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
if n == 1:
    print(("".join(sorted(s[0]))))
else:
    c = []
    for i in s:
        c.append(collections.Counter(i))
    a = c[0]
    for i in range(1, n):
        a &= c[i]
    ans = []
    a = a.most_common()
    for i in a:
        for j in range(i[1]):
            ans.append(i[0])
    print(("".join(sorted(ans))))

n = int(eval(input()))
ss = []
mins = "a" * 100
for _ in range(n):
    s = str("".join(sorted(eval(input()))))
    ss.append(s)
    if len(mins) > len(s):
        mins = s
ans = ""
for w in mins:
    ok = True
    for i, s in enumerate(ss[:]):
        if w in s:
            wi = s.find(w)
            ss[i] = s[:wi] + s[wi + 1 :]
        else:
            ok = False
    if ok:
        ans += w
print(ans)

-import collections - -s = [eval(input()) for i in range(n)] -if n == 1: -    print(("".join(sorted(s[0])))) -else: -    c = [] -    for i in s: -        c.append(collections.Counter(i)) -    a = c[0] -    for i in range(1, n): -        a &= c[i] -    ans = [] -    a = a.most_common() -    for i in a: -        for j in range(i[1]): -            ans.append(i[0]) -    print(("".join(sorted(ans)))) +ss = [] +mins = "a" * 100 +for _ in range(n): +    s = str("".join(sorted(eval(input())))) +    ss.append(s) +    if len(mins) > len(s): +        mins = s +ans = "" +for w in mins: +    ok = True +    for i, s in enumerate(ss[:]): +        if w in s: +            wi = s.find(w) +            ss[i] = s[:wi] + s[wi + 1 :] +        else: +            ok = False +    if ok: +        ans += w +print(ans)