#include <iostream>
#include <fstream>
#include <string>
using namespace std;

string input;
bool counter[4];
int main() {
    ifstream in;
    in.open ("DATA3.txt");
    ofstream out;
    out.open ("OUT3.txt");
    string curr;
    for (int i=0;i<5;i++) {
        in >> input;
        curr = "0000";
        if (curr.find((string)input) == string::npos){
           out << curr << endl;
        }
        curr = "0001";
        if (curr.find((string)input) == string::npos){
           out << curr << endl;
        }
        curr = "0000";
        for (int j=2; j<4; j++){
            curr[j] = '1';
            //out << curr;
            if (curr.find((string)input) == string::npos){
               out << curr << endl;
            }
        }
        curr = "0000";
        for (int j=1; j<4; j++){
            curr[j] = '1';
            if (j==2) {
                curr = "0101";
                if (curr.find((string)input) == string::npos){
                   out << curr << endl;
                }
                curr = "0110";
            }
            if (curr.find((string)input) == string::npos){
               out << curr << endl;
            }
        }
        curr = "0000";
        for (int j=0; j<4; j++){
            curr[j] = '1';
            //out << curr;
            if (j==1) {
                curr = "1010";
                if (curr.find((string)input) == string::npos){
                   out << curr << endl;
                }
                curr = "1100";
            }
            if (curr.find((string)input) == string::npos){
               out << curr << endl;
            }
        }
        //out << score << endl;
        //score = 0;
    }
    //system("PAUSE");
    in.close();
    out.close();
}

