Let $f, g$ be linear functions.
Define $S(x)$ as $any$ composition sequence of $f$ and $g$ like
$S(x) = (f\circ g\circ g\circ f\circ f\circ g)(x)$
Let $s$ as the fixed point of $S$ then a cycle is determined
$s \to_g g(s) \to_f (f\circ g)(s) \to_f (f\circ f\circ g)(s) \to_g (g\circ f\circ f\circ g)(s) \to_g (g\circ g\circ f\circ f\circ g)(s) \to_f s (again)$
Call $Sum_g(S)$ the sum of the terms of the cycle such that $g$ function is applied to this term.
In this example $Sum_g(S) = s + (f\circ f\circ g)(s) + (g\circ f\circ f\circ g)(s)$
Define $T(x)$ as the reversed composition sequence
$T(x) = (g\circ f\circ f\circ g\circ g\circ f)(x)$
Call $t$ the fixed point of $T$
In this example $Sum_g(T) = (f)(t) + (g\circ f)(t) + (f\circ f\circ g\circ g\circ f)(t)$
Prove that $Sum_g(S) = Sum_g(T)$
$f(x) = 3x-2$ and $g(x)=2x+1$
$S(x) = (f\circ g\circ g\circ f\circ f\circ g)(x) = 216 x + 19$ and $s = -19/215$
$T(x) = (g\circ f\circ f\circ g\circ g\circ f)(x) = 216 x - 105$ and $t = 21/43$
$Sum_g(S) = s + (f\circ f\circ g)(s) + (g\circ f\circ f\circ g)(s) = -19/215 -127/215 -39/215 = -37/43$
$Sum_g(T) = (f)(t) + (g\circ f)(t) + (f\circ f\circ g\circ g\circ f)(t) = -23/43 -3/43-11/43 = -37/43$
A visual approach
$f(x) = 3x-2$ (or any linear function)
$g(x)=x/5+1$ (or any other linear function)
Then
$ \color{red}{215/98 \to_g} \color{blue}{141/98 \to_f 227/98 \to_f} \color{red}{485/98 \to_g 195/98 \to_g} \color{blue}{137/98 \to_f} 215/98 (again)$
Obs: $215/98$ is the fixed point of $(f\circ g\circ g\circ f\circ f\circ g)(x)$
The reversed cycle is
$ 177/98 \color{red}{_g\leftarrow 395/98} \color{blue}{_f\leftarrow 197/98 _f\leftarrow 131/98} \color{red}{_g\leftarrow 165/98 _g\leftarrow 335/98} \color{blue}{_f\leftarrow 177/98} (again)$
Obs: $177/98$ is the fixed point of $(g\circ f\circ f\circ g\circ g\circ f)(x)$
why this happens?
$ \color{red}{215/98 + 485/98 + 195/98 = 395/98 + 165/98 + 335/98}$
$\color{blue}{141/98 + 227/98 + 137/98 = 197/98 + 131/98 + 177/98} $