#include <iostream>
#include <cstring>

using namespace std;

void rec(int d, string s, string t)
{
    if (d == 4)
    {
         string::size_type loc = s.find(t, 0);
         if (loc == string::npos)
         {
             cout << s << endl;
         }
    }
    else
    {
        rec(d+1, s + '0', t);
        rec(d+1, s + '1', t);
    }
}

int main()
{
    string x;
    freopen("DATA3.txt", "r", stdin);
    freopen("OUT3.txt", "w", stdout);
    for (int i = 0; i < 5; i++)
    {
        cin >> x;
        rec(0, "", x);
    }
    return 0;
}

