n = int(input()) a = [input() for _ in range(n)] b = [] for i in range(n): o = 0 for j in range(n): if a[i][j] == 'a': o += 1 b.append(o) b = sorted(set(b)) m = len(b) if m == 1: if b[0] == 0: print('a'*n) else: print('b'*n) exit() for i in range(m-1): if b[i]+1 != b[i+1]: print('a'*(b[i]+1) + 'b'*(n-b[i]-1)) exit() print('b'*n)