import java.util.*;
import java.io.*;

public class cities_sp implements Runnable {
    public static void main(String[] args) {
        new Thread(new cities_sp()).start();
    }

    @Override
    public void run() {
        try {
            br = new BufferedReader(new FileReader("cities.in"));
            out = new PrintWriter("cities.out");
            solve();
            out.close();
        } catch (FileNotFoundException e) {
        	e.printStackTrace();
        }
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;
    boolean eof = false;

    String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return "0";
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }

    long nextLong() {
        return Long.parseLong(nextToken());
    }

    void solve() {
    	int n = nextInt();
    	int sum = 0;
    	char[][] map = new char[n][];
    	for (int i = 0; i < n; i++) {
    		map[i] = nextToken().toCharArray();
    		for (char ch : map[i]) {
    			if (ch == 'C') {
    				sum++;
    			}
    		}
    	}
    	int cnt = 0;
    	for (int i = 0; i < n; i++) {
    		for (int j = 0; j < n; j++) {
    			out.print(cnt < sum / 2 ? 1 : 2);
    			if (map[i][j] == 'C') {
    				cnt++;
    			}
    		}
    		out.println();
    	}
    }
}
