N = int(input()) strings = [] for x in range(N): strings.append(input()) ans = "" def cut(str): return str[1:] while ( all( x == "" for x in strings) ): index = 0 min = strings[0] for x in range(len(strings)): if (min > x[index]): min = x index += 1 # yabai ans.append(min[:1]) strings[index] = cut(min) print(ans)