sub z{my($s,$t)=@_;return if!$t;(z($s,$t->{r},$t,z($s,$t->{l}))[$s cmp $t->{d}]}