// The "Prob1" class.
// Aditya Bansal - Aditya
import java.awt.*;
import java.io.*;

public class Prob3
{
    public static void main (String[] args) throws IOException
    {
	BufferedReader in = new BufferedReader (new FileReader ("DATA3.txt"));
	PrintWriter out = new PrintWriter (new FileWriter ("OUT3.txt"));
	String str = "";
	String $bin[] = new String [16];
	//bad code
	$bin [0] = "0000";
	$bin [1] = "0001";
	$bin [2] = "0010";
	$bin [3] = "0011";
	$bin [4] = "0100";
	$bin [5] = "0101";
	$bin [6] = "0110";
	$bin [7] = "0111";
	$bin [8] = "1000";
	$bin [9] = "1001";
	$bin [10] = "1010";
	$bin [11] = "1011";
	$bin [12] = "1100";
	$bin [13] = "1101";
	$bin [14] = "1110";
	$bin [15] = "1111";
	for (int $i = 0 ; $i < 5 ; $i++)
	{
	    str = in.readLine ();
	    String $pattern = "";
	    $pattern = str;
	    for (int $j = 0 ; $j < 16 ; $j++)
	    {
		if (($bin [$j].indexOf ($pattern)) == -1)
		{
		    out.println ($bin [$j]);
		}
	    }
	}
	out.close ();
	// Place your program here.  'c' is the output console
    } // main method
} // Prob1 class

