On Multistage Networks with Ternary Switching Elements