A lattice-gas model for three immiscible fluids