Competition between Kondo effect and magnetic interaction in Kondo systems