Electron spin resonance of Gd in the intermetallic compounds YCu, YAg, and LaAg: Wave vector dependence of the exchange interaction