import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Queue;

class Solver {

    int size;    
    int[][] map;

    // add other useful attributes
    
    public Solver(int size) {
	this.size = size;
	map = new int[size][size];

	// to be fulfilled
    }

    public void readMap(BufferedReader br) throws IOException {

	// to be fulfilled: read input using br and init map with with, for example:
	// 0 for a free space
	// 1 for a mine
	// meanwhile, also detect where are the 3 villages.
    }

    public void printMap() {
	for(int i=0;i<size;i++) {
	    for(int j=0;j<size;j++) {
		System.out.print(map[i][j]);
	    }
	    System.out.println();
	}
    }

    public void solve() {

	// to be fulfilled
    }
}

class Demineur {
    public static void main(String[] args) {
	try {
	    Solver solve = null;
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String line = br.readLine();
	    int size = Integer.parseInt(line);
	    solve = new Solver(size);
	    solve.readMap(br);
	    solve.solve();
	}
	catch(IOException e) {
	    System.err.println("cannot read input file");
	}
    }
}
