using System; using System.Text.RegularExpressions; class X{static void Main(){for(;;){var l=Console.ReadLine();while(l[0]>'1'){var s=Regex.Match(l,@"{\d+}").Value;l=l.Replace(s,s.Length+2<2*s.Replace("1","").Length?"0":"1");}Console.WriteLine(l);}}}