Balanced Allocations for Tree-Like Inputs