sub f{($s,$t)=@_;while($t->{d}ne$s){$t=($s lt $t->{d})?$t->{l}:$t->{r};return if$t==0;}return$t;}