Rare-Earth-Iron Exchange Interaction in the Garnets. I. Hamiltonian for Anisotropic Exchange Interaction