import java.awt.*;
import java.io.*;

public class Problem5
{

    public static void main (String[] args) throws IOException
    {
	BufferedReader input = new BufferedReader (new FileReader ("DATA5.txt"));
	PrintWriter output = new PrintWriter (new FileWriter ("OUT5.txt"));

	char peice[] [] = new char [4] [4];
	for (int x = 0 ; x < 4 ; x++)
	{
	    for (int y = 0 ; y < 4 ; y++)
		peice [x] [y] = (char) (input.read ());
	    input.readLine ();
	}

	int firstx = 0;
	int firsty = 0;
	boolean check = true;

	int hand = 0; //1 - square, 2 - stick, 3 - tee, 4 - zed right, 5 - zed left, 6 - L right, 7 - L left

	for (int x = 0 ; x < 4 ; x++)
	{
	    for (int y = 0 ; y < 4 ; y++)
		if (peice [x] [y] == '#')
		{
		    firstx = x;
		    firsty = y;
		    check = false;
		    break;
		}
	    if (check == false)
		break;
	}

	output.println ("3");
	output.println ("1");
	output.println ("2");
	output.println ("0");
	output.println ("3");

	output.close ();
    } // main method
} // Problem5 class



