Neutral strange particle production in π− p, π− n and π− C interactions at 40 GeV/c