public static void test() throws IOException{
		PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("input.in")));
		out.print(m + " " + n + "\n");
		for(int i=0;i<m;i++){
			for(int j=0;j<n;j++){
				if(0<=j&&j<3&&0<=i&&i<3){
					out.print(".");
				}
				else{
					int x=(int)(Math.random()*100);
					if(x<density) out.print("X");
					else out.print(".");
				}
			}
			out.println();
		}
		out.close();
	}