n = int(eval(input()))

a = list(eval(input()) for _ in range(n))

# n = 3

# a = ["cbaa","daacc","acacac"]

s = ""

for c in a[0]:

    f = []

    for i in range(n-1):

        if c not in a[i+1]:

            break

        for d in range(len(a[i+1])):

            if c == a[i+1][d]:

                f.append(d)

                break

    else:

        s += str(c)

        for i in range(n-1):

            a[i+1] = a[i+1][:f[i]] +""+ a[i+1][f[i]+1:]

        

ns = "".join(sorted(s))

print(ns)
def intersect_list(lst1, lst2):

    arr = []

    lst = lst1.copy()

    for element in lst2:

        try:

            lst.remove(element)

        except ValueError:

            pass

        else:

            arr.append(element)

    return arr



n = int(eval(input()))

a0 = list(eval(input()))

for i in range(n-1):

    a  = list(eval(input()))

    a0 = intersect_list(a0, a)



print(("".join(sorted(a0))))
n = int(eval(input()))
a = list(eval(input()) for _ in range(n))
# n = 3
# a = ["cbaa","daacc","acacac"]
s = ""
for c in a[0]:
    f = []
    for i in range(n - 1):
        if c not in a[i + 1]:
            break
        for d in range(len(a[i + 1])):
            if c == a[i + 1][d]:
                f.append(d)
                break
    else:
        s += str(c)
        for i in range(n - 1):
            a[i + 1] = a[i + 1][: f[i]] + "" + a[i + 1][f[i] + 1 :]
ns = "".join(sorted(s))
print(ns)

def intersect_list(lst1, lst2):
    arr = []
    lst = lst1.copy()
    for element in lst2:
        try:
            lst.remove(element)
        except ValueError:
            pass
        else:
            arr.append(element)
    return arr


n = int(eval(input()))
a0 = list(eval(input()))
for i in range(n - 1):
    a = list(eval(input()))
    a0 = intersect_list(a0, a)
print(("".join(sorted(a0))))

+def intersect_list(lst1, lst2): +    arr = [] +    lst = lst1.copy() +    for element in lst2: +        try: +            lst.remove(element) +        except ValueError: +            pass +        else: +            arr.append(element) +    return arr + + -a = list(eval(input()) for _ in range(n)) -# n = 3 -# a = ["cbaa","daacc","acacac"] -s = "" -for c in a[0]: -    f = [] -    for i in range(n - 1): -        if c not in a[i + 1]: -            break -        for d in range(len(a[i + 1])): -            if c == a[i + 1][d]: -                f.append(d) -                break -    else: -        s += str(c) -        for i in range(n - 1): -            a[i + 1] = a[i + 1][: f[i]] + "" + a[i + 1][f[i] + 1 :] -ns = "".join(sorted(s)) -print(ns) +a0 = list(eval(input())) +for i in range(n - 1): +    a = list(eval(input())) +    a0 = intersect_list(a0, a) +print(("".join(sorted(a0))))