n=int(input())
L=[[]for _ in range(n)]
f=[]
for i in range(n):
t=input()
for j in range(n):
L[i].append(t[j])
if t[j]=='*':
f.append((i,j))
for o in f:
for i in range(n):
L[i][o[1]]='*'
for j in range(n):
L[o[0]][j]='*'
for i in L:
print(*i,sep='')