<>;$_=<>;y/012 /120/duntil/^.0/;print/00|[12]{2}|(.)0\1/?0:/.$/g