@@How this problem works

@@FP

\ni Given word w. If exponential sums for all letters in w are
even then w can be rewritten as a product of squares and 
commutators in the free group using standard operation.
We get the first letter and find in w this letter or it's 
inverse. If we get it's inverse we compose a commutator  
(see @Rewriting of a word as a product of commutators@probs/CommutatorRewriteProblem::FP@). If we get the letter itself we again find 
subwords that are equal starting from found letters. Then
'a' is the first subword and 'b' is the subword between
found ones, so w = (a b)^2 b^-1 w_1, where w's length is greater
then b^-1 w_1's one and so on. Finally all commutators are
rewritten in the form [a,b] = (a^-1 b^-1)^2  b^2  (b^-1 a b)^2.   

\ni If w doesn't have even exponential sums but w is trivial 
in abelianization with additional relators x_1^2 , ... , x_n^2,
where x_i are group generators then multiplying w by some 
trivial word v we can get the new word w_1 = w, but w_1 can be 
rewritten as a product of commutators and squares in the free
group yet. To obtain v we find some solution for the equation 

\ni w = r_1^x_1 ... r_k^x_k 

\ni in abelianization with additional relators. Then we work with w1.