In-beam investigation of ternary fission