# ABC058C - 怪文書 / Dubious Document (ARC071C)

import sys

input = sys.stdin.readline



from collections import OrderedDict

from string import ascii_lowercase





def main():

    n = int(eval(input()))

    lst = [input().rstrip() for _ in range(n)]

    cnt = OrderedDict.fromkeys(ascii_lowercase, 0)

    for i in lst[0]:

        cnt[i] += 1



    for i in lst[1:]:

        tmp = OrderedDict.fromkeys(ascii_lowercase, 0)

        for j in i:

            tmp[j] += 1

        for i in list(cnt.keys()):

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



    ans = ""

    for i, j in list(cnt.items()):

        ans += i * j

    print(ans)





if __name__ == "__main__":

    main()
# ABC058C - 怪文書 / Dubious Document (ARC071C)

from collections import Counter

from string import ascii_lowercase





def main():

    N = int(eval(input()))

    D = tuple(Counter(eval(input())) for _ in range(N))

    ans = ""

    for s in ascii_lowercase:

        if all(s in d for d in D):

            ans += s * min(d[s] for d in D)

    print(ans)





if __name__ == "__main__":

    main()
# ABC058C - 怪文書 / Dubious Document (ARC071C)
import sys

input = sys.stdin.readline
from collections import OrderedDict
from string import ascii_lowercase


def main():
    n = int(eval(input()))
    lst = [input().rstrip() for _ in range(n)]
    cnt = OrderedDict.fromkeys(ascii_lowercase, 0)
    for i in lst[0]:
        cnt[i] += 1
    for i in lst[1:]:
        tmp = OrderedDict.fromkeys(ascii_lowercase, 0)
        for j in i:
            tmp[j] += 1
        for i in list(cnt.keys()):
            cnt[i] = min(cnt[i], tmp[i])
    ans = ""
    for i, j in list(cnt.items()):
        ans += i * j
    print(ans)


if __name__ == "__main__":
    main()

# ABC058C - 怪文書 / Dubious Document (ARC071C)
from collections import Counter
from string import ascii_lowercase


def main():
    N = int(eval(input()))
    D = tuple(Counter(eval(input())) for _ in range(N))
    ans = ""
    for s in ascii_lowercase:
        if all(s in d for d in D):
            ans += s * min(d[s] for d in D)
    print(ans)


if __name__ == "__main__":
    main()

-import sys - -input = sys.stdin.readline -from collections import OrderedDict +from collections import Counter -    n = int(eval(input())) -    lst = [input().rstrip() for _ in range(n)] -    cnt = OrderedDict.fromkeys(ascii_lowercase, 0) -    for i in lst[0]: -        cnt[i] += 1 -    for i in lst[1:]: -        tmp = OrderedDict.fromkeys(ascii_lowercase, 0) -        for j in i: -            tmp[j] += 1 -        for i in list(cnt.keys()): -            cnt[i] = min(cnt[i], tmp[i]) +    N = int(eval(input())) +    D = tuple(Counter(eval(input())) for _ in range(N)) -    for i, j in list(cnt.items()): -        ans += i * j +    for s in ascii_lowercase: +        if all(s in d for d in D): +            ans += s * min(d[s] for d in D)