sub g { ($n=pop)--?[map("0$_",@l=@{g($n)}),map"1$_",reverse@l]:[''] }