Electric Field Gradients in Hexagonal Crystals of Cd, Zn, Gd, and Te Acting on Sm, W, and Os Impurities