Place and detonate bombs so that all the wooden objects touch fire and all the metal object touch water.