Electromagnetic wave scattering by a plane metallic grating loaded with three dielectric layers