while(<>){
while ( s/(1{2,})0/"-1".(0 x (-1+length($1))).1/e ){;}
s/0$//;
s/0|1/$& /g;
}
d2hpbGUoPD4pewoJJF89IHNwcmludGYgIjAlYiIsICRfOwoJJF89cmV2ZXJzZSAkXzsKCXdoaWxlICggcy8oMXsyLH0pMC8iLTEiLigwIHggKC0xK2xlbmd0aCgkMSkpKS4xL2UgKXs7fQoJcy8wJC8vOwoJcy8wfDEvJCYgL2c7CglAXz1yZXZlcnNlIChzcGxpdC8gLywkXyk7CglwcmludCAiQF9cbiI7Cgl9