Sprite sorting order, background behind middleground but in front of foreground

Ive got 3 layers A “foreground” a “middleground” and a “background” I want the backround to be drawn on top of the foreground but still behind the middleground. I also want the foreground infront of the middleground. How would I go about doing this? I hope you understand my question :stuck_out_tongue:

You’ve described a logical impossibility:

B > F

B < M

F > M