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

import sys

input = sys.stdin.readline



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)

from functools import reduce





def main():

    N = int(input())

    if N == 1:

        print(*sorted(input()), sep="")

        return

    S = tuple(input() for _ in range(N))

    ch = sorted(reduce(lambda a, b: set(a) & set(b), S))

    ans = ""

    for i in ch:

        ans += i * min(s.count(i) for s in S)

    print(ans)





if __name__ == "__main__":

    main()

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

input = sys.stdin.readline
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)
from functools import reduce


def main():
    N = int(input())
    if N == 1:
        print(*sorted(input()), sep="")
        return
    S = tuple(input() for _ in range(N))
    ch = sorted(reduce(lambda a, b: set(a) & set(b), S))
    ans = ""
    for i in ch:
        ans += i * min(s.count(i) for s in S)
    print(ans)


if __name__ == "__main__":
    main()

-import sys - -input = sys.stdin.readline -from collections import Counter -from string import ascii_lowercase +from functools import reduce -    N = int(eval(input())) -    D = tuple(Counter(eval(input())) for _ in range(N)) +    N = int(input()) +    if N == 1: +        print(*sorted(input()), sep="") +        return +    S = tuple(input() for _ in range(N)) +    ch = sorted(reduce(lambda a, b: set(a) & set(b), S)) -    for s in ascii_lowercase: -        if all(s in d for d in D): -            ans += s * min(d[s] for d in D) +    for i in ch: +        ans += i * min(s.count(i) for s in S)