A lattice-statistical model for ternary polymer mixtures: exact phase diagrams