Measurement of the ratios of branching fractions B (B(s)(0)-> D(s)(-) pi(+) pi(+) pi(-))/B(B(0) -> D(-) pi(+) pi(+) pi(-)) and B(B(s)(0) -> D(s)(-) pi(+))/B(B(0)-> D(-) pi(+))