Determine all triples of positive integers $(A,B,C)$ for which some function $f \colon \mathbb Z_{\geq 0} \to \mathbb Z_{\geq 0}$ satisfies \[ f^{f(y)} (y + f(2x)) + f^{f(y)} (2y) = (Ax+By)^{C} \]for all nonnegative integers $x$ and $y$, where $f^k$ as usual denotes $f$ composed $k$ times. Proposed by Benny Wang