Protect input from modification in brown-tarjan-merge{,-with}