The values and signs of the contributions to the superexchange interaction of Co3+ ions in LaCoO3 in different spin states, namely, the superexchange of a pair of ions in the intermediate (IS) state and the superexchange of a pair of ions, one of which is in the intermediate state and the other in the high-spin (HS) state, are studied. For this purpose, virtual electron-hole pairs produced in the course of superexchange (the so-called exchange loops) have been studied within the framework of a multiband generalization of the Hubbard model. It is shown that the cobalt ions in the intermediate state are ordered ferromagnetically, while a pair of ions in different HS and IS states makes an AFM contribution to the superexchange.