Electron paramagnetic resonance of La1.85Sr0.15CuO4La2CuO4 and La2NiO4 doped with Gd3+