The lengths of the sides of the polygon are $a_1$, $a_2$,. $..$ ,$a_n$. The square trinomial $f(x)$ is such that $f(a_1) = f(a_2 +...+ a_n)$. Prove that if $A$ is the sum of the lengths of several sides of a polygon, $B$ is the sum of the lengths of its remaining sides, then $f(A) = f(B)$.