from collections import Counter
n = int(input())
S = [input() for _ in range(n)]
s_counters = [Counter(s) for s in S]
base = s_counters[0]
for i in range(1, n):
    base = base & s_counters[i]
ans = []
for k, v in base.items():
    ans += (k * v)
print("".join(sorted(ans)))
151f83387627f215ce726bbceae2caa0e6d5b8f4
<mask token>

<mask token>
for i in range(1, n):
    base = base & s_counters[i]
<mask token>
for k, v in base.items():
    ans += k * v
print(''.join(sorted(ans)))

<mask token>
n = int(input())
S = [input() for _ in range(n)]
s_counters = [Counter(s) for s in S]
base = s_counters[0]
for i in range(1, n):
    base = base & s_counters[i]
ans = []
for k, v in base.items():
    ans += k * v
print(''.join(sorted(ans)))

from collections import Counter
n = int(input())
S = [input() for _ in range(n)]
s_counters = [Counter(s) for s in S]
base = s_counters[0]
for i in range(1, n):
    base = base & s_counters[i]
ans = []
for k, v in base.items():
    ans += k * v
print(''.join(sorted(ans)))

from collections import Counter
n = int(input())
S = [input() for _ in range(n)]
s_counters = [Counter(s) for s in S]
base = s_counters[0]
for i in range(1, n):
    base = base & s_counters[i]
ans = []
for k, v in base.items():
    ans += (k * v)
print("".join(sorted(ans)))