#include <iostream>
using namespace std;
bool check(string str1,string str2)
{
cout<<"inside temp = "<<str1<<" res = "<<str2<<"n";
int m,n;
m=str2.size();
n=str1.size();
int j = 0;
for (int i = 0; i < n && j < m; i++){
if (str1[i] == str2[j])
{
j++;
}
}
return (j == m);
}
int main() {
string str,res;
cin>>str;
if(str[str.size()-1]=='0')
{
res+='1';
}
else
{
res+='0';
}
//cout<<res;
string temp;
temp=str[str.size()-1];
for(int i=str.size()-2;i>=0;i--)
{
temp=str[i]+temp;
if(check(temp,res))
{
cout<<"temp = "<<temp<<" res = "<<res<<"n";
if(check(temp,res+'0'))
{
res=res+'0';
}
else if(check(temp,res+'1'))
{
res=res+'1';
}
else if(check(temp,'1'+res))
{
res='1'+res;
}
cout<<"new res = "<<res<<"n";
}
}
cout<<res<<"n";
return 0;
}