import sys

sys.stdin = open('cities.in')
sys.stdout = open('cities.out', 'w')

N = int(input())
s = "".join([input() for i in range(N)])
C = s.count('C') // 2
count = 0
for i in range(N * N):
    if i % N == 0 and i > 0:
        print()
    if s[i] == 'C':
        count += 1
    if count <= C:
        print(1, end = '')
    else:
        print(2, end = '')
    