#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

bool find (string a, string b){
	size_t found;
	found=b.find(a);
	if (found!=string::npos){
		return true;
	}
	return false;
}

void create (string c, string s, int l){
	if (find(s,c)==true){
		return;
	}
	else if (l==4){
		cout << c << endl;
		return;
	}
	create(c+"0", s, l+1);
	create(c+"1", s, l+1);
	return;
}

int main (){
	freopen ("data3.txt", "r", stdin);
	freopen ("out3.txt", "w", stdout);	
	string s;
	int z;
	
	for (z=0; z<5; ++z){
		cin >> s;
		create("", s, 0);
	}
	
	return 0;
} 
	

