N = int(input())
S = list(input())

flag = False
countA = 0
countB = 0
T = []
for i in range(N):
  if S[i] == '#':
    for j in range(N):
      if j >= i:
        T.append('#')
      else:
        T.append('.')
      if S[j] != T[j]:
        countA = countA + 1
    break
print(T)

T = []
for i in reversed(range(N)):
  if S[i] == '.':
    for j in range(N):
      if j > i:
        T.append('#')
      else:
        T.append('.')
      if S[j] != T[j]:
        countB = countB + 1
    break
print(T)

if countA < countB:
  print(countA)
else:
  print(countB)
