The zeroth law of thermodynamics for three systems A