_,*s=open(0)

for c in map(chr,range(97,123)):print(c*min(t.count(c)for t in s),end='')

_,*s=open(0)

for c in sorted(set(s[0])):print(c*min(t.count(c)for t in s),end='')

_, *s = open(0)
for c in map(chr, range(97, 123)):
    print(c * min(t.count(c) for t in s), end="")

_, *s = open(0)
for c in sorted(set(s[0])):
    print(c * min(t.count(c) for t in s), end="")

-for c in map(chr, range(97, 123)): +for c in sorted(set(s[0])):