import java.io.*;

public class cities_sm {

    void solve() throws IOException {
        int n = Integer.parseInt(br.readLine());
        char[][] f = new char[n][];
        int citiesCount = 0;
        for (int i = 0; i < n; i++) {
            f[i] = br.readLine().toCharArray();
            assert f[i].length == n;
            for (int j = 0; j < n; j++) {
                assert f[i][j] == 'C' || f[i][j] == 'D';
                if (f[i][j] == 'C') {
                    citiesCount++;
                }
            }
        }
        assert citiesCount > 0 && citiesCount % 2 == 0;
        citiesCount /= 2;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (f[i][j] == 'C') {
                    citiesCount--;
                }
                if (citiesCount >= 0) {
                    out.print("1");
                } else {
                    out.print("2");
                }
            }
            out.println();
        }
    }

    BufferedReader br;
    PrintWriter out;

    void run() throws IOException {
        br = new BufferedReader(new FileReader("cities.in"));
        out = new PrintWriter(new BufferedWriter(new FileWriter("cities.out")));
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new cities_sm().run();
    }
}
