Answer
The former has more free energy. This is clear since ATP has much more energy in it than ADP+Pi, and that is usually a catabolic reaction used to drive other reactions, such as the synthesis of glutamine here.
Work Step by Step
The key is to see that ATP hydrolysis usually energetically dominates reactions in which it is a part, so look for the ATP to see where the greater amount of chemical energy is found.