import java.io.BufferedReader;
import java.io.InputStreamReader;


public class MORE
{
	static public String negaBinary(int number) {
		String output = "";
		while(number != 0) {
			int zvysok = number % (-2);
			number /= (-2);
			if(zvysok < 0) {
				number += 1;
				zvysok *= (-1);
			}
			output = zvysok+output;
		}
		return output;
	}
	
	static public char[] chars = new char[1000020];
	static public int charsLength;
	static public StringBuilder builder = new StringBuilder(1000002);
	
	public static void main(String[] args) throws Exception
	{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while((line = reader.readLine()) != null) {
			if(line.equals("")) {
				break;
			}
			
			char[] ar = line.toCharArray();
			for(int i=0; i<ar.length; i++) {
				chars[i] = ar[i];
			}
			charsLength = ar.length;
			
			builder.setLength(0);
			
			boolean shouldContinue = true;
			while(shouldContinue) {
				if(endsWith('0', '1')) {
					builder.append("01");
					shouldContinue = true;
				} else if(endsWith('1', '1')) {
					builder.append("00");
					shouldContinue = false;
				} else if(endsWith('1', '0')) {
					builder.append("11");
					shouldContinue = false;
				} else if(endsWith('0', '0')) {
					builder.append("10");
					shouldContinue = false;
				}
				charsLength -= 2;
			}
			
			if(charsLength < 0) {
				charsLength = 0;
			}
			for(int i=0; i<builder.length(); i++) {
				chars[charsLength+i] = builder.charAt(builder.length()-i-1);
			}
			charsLength += builder.length();
			
			boolean found = false;
			for(int i=0; i<charsLength; i++) {
				if(chars[i] == '1') {
					found = true;
					System.out.print('1');
				} else if(found) {
					System.out.print('0');
				}
			}
			if(found == false) {
				System.out.print('0');
			}
			System.out.println();
		}
	}
	
	static public boolean endsWith(char c1, char c2) {
		if(charsLength <= 0) {
			return c1 == '0' && c2 == '0';
		}
		if(charsLength >= 2) {
			return chars[charsLength-2] == c1 && chars[charsLength-1] == c2;
		}
		return chars[0] == c2 && c1 == '0';
	}
}
