your car likely has self levelling suspension and adaptive
damping system. this problem needs to be diagnosed by a good MB specialty shop before any work is done. you may just need rear accumulators, as these fail often. replacing
shocks usually fixes nothing after spending $670 EACH on just the parts! let them fix it for you.
If it is an S600 it wont have shocks- it is a hydro-pneumatic system. The struts are probably what you are referring to. The best way to replace them is to take it to an authorized mechanic who knows Mercedes-Benz and let them fix it. Struts run $1500-$2000 each depending on your location. Count on an expensive fix for the ABC suspension system.