  Let $f \in C^2(\mathbb{T}^2)$ have mean value 0 and consider $$
\sup_{\gamma~{\tiny \mbox{closed geodesic}}}{~~~ \frac{1}{|\gamma|} \left|
\int_{\gamma}{ f ~~d\mathcal{H}^1}\right| },$$ where $\gamma$ ranges over all
closed geodesics $\gamma:\mathbb{S}^1 \rightarrow \mathbb{T}^2$ and $|\gamma|$
denotes their length. We prove that this supremum is always attained. Moreover,
we can bound the length of the geodesic $\gamma$ attaining the supremum in
terms of \textit{smoothness} of the function: for all $s \geq 2$, $$
|\gamma|^{s} \lesssim_s \left( \max_{|\alpha| = s}{ \| \partial_{\alpha} f
\|_{L^{1}(\mathbb{T}^2)}} \right) \| \nabla f \|_{L^2}^{} \|f\|_{L^2}^{-2}.$$
We also prove a sharp bound for trigonometric polynomials. This seems like an
interesting phenomenon. We do not know at which level of generality it holds or
whether versions or variants of it could be established in other settings
(hyperbolic surfaces, groups,...).
