Let $G \subset \mathbb C$ be a domain and $f: G \to \mathbb C$ a continuous function such that for any closed and rectifiable path $\gamma \subset G$, $$ \left| \oint_\gamma f(z)dz \right|\leq \left( L(\gamma)\right)^3. $$ Where $L(\gamma)$ denote the arc length of the path $\gamma$, that is $L(\gamma)=\int_\gamma |dz|$. Prove that $f$ is holomorphic in $G$.
My Ideas: This looks like a good candidate to use the powerful result of Morera´s Theorem, which tells us that is enough to prove that $\oint_\gamma f(z)dz$ vanishes for any closed path $\gamma \subset G$. However I don't seem to put together a good argument and I am starting to believe this may be prove in another way.
Why 3? Why use the $3$ in "$\leq \left( L(\gamma)\right)^3$"? I guess I would know that if I could prove it but do the assertion still holds if we replace $3$ by $2$, $5$, $8$ or any other whole number?
Any help on how proving this or hints will be very appreciated.

Take any curve $\gamma$ that traces a rectangle. Split the rectangle into $n^2$ smaller rectangles, traced by curves $(\kappa_i)_{1\le i \le n^2}$ whose lengths are $1/n$ times the length of $\gamma$. Then $$ \oint_\gamma f(z) \, dz = \sum_{i=1}^{n^2} \oint_{\kappa_i} f(z) \, dz.$$ Go from there.
From this you see that the 3 can be replaced by any number strictly bigger than 2. But 2 won't work. This follows by seeing that for almost any small enough $f$ that is smooth, and by using the Gauss-Green formula, that the inequality holds with 2, because the area enclosed by a curve is always bounded its length squared times $1/4\pi$.