Measurements of the branching fractions for B-(s) -> D-(s)pi pi pi and Lambda(0)(b) -> Lambda(+)(c)pi pi pi