Glk 350 2014

When i start the car it wont gobin drive or reverse. sometimes when in drive it wont go in reverse and vice versa