from collections import*;c=eval(("Counter(list(input()))&"*int(eval(input())))[:-1]);print(("".join(sorted(v*k for k,v in list(c.items())))))
_,*s=open(0);print(("".join(sorted(c*min(t.count(c)for t in s)for c in set(s[0])))))
from collections import *

c = eval(("Counter(list(input()))&" * int(eval(input())))[:-1])
print(("".join(sorted(v * k for k, v in list(c.items())))))

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

-from collections import * - -c = eval(("Counter(list(input()))&" * int(eval(input())))[:-1]) -print(("".join(sorted(v * k for k, v in list(c.items()))))) +_, *s = open(0) +print(("".join(sorted(c * min(t.count(c) for t in s) for c in set(s[0])))))