How we will choose reference point for more than two particle system to calculate potential energy as in the case of of equilateral triangle?

Suppose there are three mass, $$m_1$$, $$m_2$$, $$m_3$$. In the case of equilateral triangle we bring $$m_1$$ which has zero potential energy then we bring $$m_2$$ and consider $$m_1$$ and $$m_2$$ as one pair and calculate the potential energy of the 1st pair. After this my confusion starts, when we bring the third mass i.e. $$m_3$$, we calculate its potential energy considering again that at infinity the PE is zero and then get the total potential energy. So do we have choose the same reference point for each pairs to calculate the gravitational potential energy. can we change the refence point for different pairs, eg for the 1st pair $$PE=0$$ is at Infinity and then for the second pair $$PE=0$$ is when seperation is let say $$a$$: because Each pair is independently added. if not then why we choose same reference i.e, at infinity for each pair?