I was flying on level 360 from ULLI to EDDK, with LNAV and VNAV on. I accidentally hit a button for A/P Servos toggle, and the VNAV started heading the plane up and down. I've levelled it off, reengaged VNAV. but then, I noticed that I was getting off the flight path. The flight directors were showing to turn right. The LNAV, VNAV and CMD A were engaged, nothing on the FMC. I've tried to go to HDG SEL, and noticed that the plane turned slightly right and went straight, not following my commands. I then turned the yoke to the left, which disengaged LNAV and showed a CWS R yellow on the PFD. I went onto the path, but when i let go of the yoke, it turned itself right again> I couldn't solve this issue while in the air, and i had to quit. While everything was happening, the pitch trimm also wanted to go somewhere all the time.
Please help me.
Regards,
Dmitrii.