from string import ascii_lowercase N = int(input()) strings = [] re = "" for x in range(N): strings.append(input()) """ ans = "" def cut(str): return str[1:] while ( not all( x == "" for x in strings) ): min = strings[0] for x in strings: if (min[0] > x[0]): min = x ans += min[0] if (cut(min) == ""): strings.pop(strings.index(min)) else: strings[strings.index(min)] = cut(min) print(ans) """ dic = {} for i in ascii_lowercase: dic[i] = 0 for string in strings: for x in string: dic[x] += 1 for key in dic.keys(): re += key*dic[key] print(re)