import string



INF = float('inf')



n = int(eval(input()))

ss = [eval(input()) for _ in range(n)]



ans_d = {c: INF for c in string.ascii_lowercase}  # AtoZ

for s in ss:

    d = {c: 0 for c in string.ascii_lowercase}  # AtoZ

    for c in s:

        d[c] += 1

    for c in string.ascii_lowercase:

        ans_d[c] = min(ans_d[c], d[c])



ans = ''

for c in string.ascii_lowercase:

    ans += c * ans_d[c]

print(ans)
def main():

    orda = ord('a')



    N = int(eval(input()))



    ctr = [50] * 26

    for _ in range(N):

        s = eval(input())

        t = [0] * 26

        for c in s:

            i = ord(c) - orda

            t[i] += 1



        for i, cnt in enumerate(t):

            ctr[i] = min(ctr[i], cnt)



    ans = ''

    for i, cnt in enumerate(ctr):

        ans += chr(i + orda) * cnt

    print(ans)





if __name__ == '__main__':

    main()



# import sys

# input = sys.stdin.readline

# 

# sys.setrecursionlimit(10 ** 7)

# 

# (int(x)-1 for x in input().split())

# rstrip()

#

# def binary_search(*, ok, ng, func):

#     while abs(ok - ng) > 1:

#         mid = (ok + ng) // 2

#         if func(mid):

#             ok = mid

#         else:

#             ng = mid

#     return ok

import string

INF = float("inf")
n = int(eval(input()))
ss = [eval(input()) for _ in range(n)]
ans_d = {c: INF for c in string.ascii_lowercase}  # AtoZ
for s in ss:
    d = {c: 0 for c in string.ascii_lowercase}  # AtoZ
    for c in s:
        d[c] += 1
    for c in string.ascii_lowercase:
        ans_d[c] = min(ans_d[c], d[c])
ans = ""
for c in string.ascii_lowercase:
    ans += c * ans_d[c]
print(ans)

def main():
    orda = ord("a")
    N = int(eval(input()))
    ctr = [50] * 26
    for _ in range(N):
        s = eval(input())
        t = [0] * 26
        for c in s:
            i = ord(c) - orda
            t[i] += 1
        for i, cnt in enumerate(t):
            ctr[i] = min(ctr[i], cnt)
    ans = ""
    for i, cnt in enumerate(ctr):
        ans += chr(i + orda) * cnt
    print(ans)


if __name__ == "__main__":
    main()
# import sys
# input = sys.stdin.readline
#
# sys.setrecursionlimit(10 ** 7)
#
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

-import string +def main(): +    orda = ord("a") +    N = int(eval(input())) +    ctr = [50] * 26 +    for _ in range(N): +        s = eval(input()) +        t = [0] * 26 +        for c in s: +            i = ord(c) - orda +            t[i] += 1 +        for i, cnt in enumerate(t): +            ctr[i] = min(ctr[i], cnt) +    ans = "" +    for i, cnt in enumerate(ctr): +        ans += chr(i + orda) * cnt +    print(ans) -INF = float("inf") -n = int(eval(input())) -ss = [eval(input()) for _ in range(n)] -ans_d = {c: INF for c in string.ascii_lowercase}  # AtoZ -for s in ss: -    d = {c: 0 for c in string.ascii_lowercase}  # AtoZ -    for c in s: -        d[c] += 1 -    for c in string.ascii_lowercase: -        ans_d[c] = min(ans_d[c], d[c]) -ans = "" -for c in string.ascii_lowercase: -    ans += c * ans_d[c] -print(ans) + +if __name__ == "__main__": +    main() +# import sys +# input = sys.stdin.readline +# +# sys.setrecursionlimit(10 ** 7) +# +# (int(x)-1 for x in input().split()) +# rstrip() +# +# def binary_search(*, ok, ng, func): +#     while abs(ok - ng) > 1: +#         mid = (ok + ng) // 2 +#         if func(mid): +#             ok = mid +#         else: +#             ng = mid +#     return ok