import java.util.*;
import java.io.*;
/**
 * Write a description of class Problem1 here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Pro3
{
    



    
    public static void main (String args[]) throws IOException
    {
        Scanner kb = new Scanner( new File("DATA3.txt"));
        PrintWriter xyz = new PrintWriter (new BufferedWriter (new FileWriter("OUT3.txt")));
        for (int x=0;x<5;x++)
        {
            int counter=0;
            String[] nums =  new String[16];
            
          nums[0]="0000";
          nums[1]="0001";
          nums[2]="0010";
          nums[3]="0011";
          nums[4]="0100";
          nums[5]="0101";
          nums[6]="0110";
          nums[7]="0111";
          nums[8]="1000";
          nums[9]="1001";
          nums[10]="1010";
          nums[11]="1011";
          nums[12]="1100";
          nums[13]="1101";
          nums[14]="1110";
          nums[15]="1111";
            
            String s = kb.nextLine();
            
            
            for (int z=0;z<16;z++)
            {
                if (nums[z].indexOf(s)==-1)
                xyz.println(nums[z]);
            }
            
            
                                    
              
              
        
        
        }
        xyz.close();
    }
}

