sub f { $t=pop;$t=$$t{$c>0?l:r}while$c=$$t{d}cmp$_[0]and$t;$t }