Build a bridge to let the train safely cross the valley. Build a bridge with the given amount of materials to let the train safely cross the valley.