Synthesis of 1,3,4-trihaloalkanes