n = int(input()) L = list(input()) L_len = len(L) for i in range(n - 1): L2 = list(input()) for j in range(L_len): if L[j] != L2[j]: L[j] = '?' print(''.join(L))