If you write down the equation F = GmM/rē , you get a positive force for positive masses , yes ?
This means that the masses are attracted to each other . So you get : O----> <-----O
While the acceleration is a= F/m and the masses are positive the acceleration has the same direction as the force . So the masses move towards each other . If a mass is negative the accleration has the opposite direction of the force .
If you write down the same equations for the other cases I'm sure you'll come to the answer of your question..