  A mechanism of a superconductivity-mediated interaction of two magnets in a
system of coupled superconductor/ferromagnet/superconductor (S/F/S) Josephson
junctions (JJs) with spin-orbit interaction is proposed. The predicted indirect
magnetic interaction favors the antiparallel orientation of the magnets. Its
spatial scale is not restricted by the proximity length scales of the
superconductor. Our estimates suggest that the interaction strength is not
reduced considerably even at the macroscopic scales of the order of
millimeters. At larger distances $l$ between the magnets the coupling constant
exhibits the long-range power law $1/l$ behavior. The mechanism of the
interaction is based on two key ingredients: (i) the anomalous ground state
phase shift in the S/F/S JJ provides a magnetoelectric coupling between the
condensate phase and the magnetization and (ii) the interaction is mediated by
the condensate phase of the superconducting region connecting both JJs. In
addition we demonstrate high tunability of the total magnetic configuration of
the system by the externally controlled superconducting phase between the
leads.
