$$p + q = e_1,\quad pq = e_2 \;\implies\; p^2 + q^2 = e_1^2 - 2e_2,\quad p^3 + q^3 = e_1^3 - 3e_1 e_2.$$
Any expression that is unchanged when you swap the variables can be rewritten using only their elementary symmetric sums (the sum and the product), collapsing many variables into a few.