Let G be the ABC barycenter. A line intersects the medians AD, BE and CF in X, Y and Z, respectively. Prove that $$\frac{XD}{XG}+\frac{YE}{YG}+\frac{ZF}{ZG}=3$$
By areas relations I found that
$\frac{XG\cdot YG}{BG\cdot DG}=\frac{6SG_{\triangle XYG}}{S_{\triangle ABC}}\\ \frac{XG\cdot ZG}{CG\cdot DG}=\frac{6SG_{\triangle XZG}}{S_{\triangle ABC}}\\ \frac{YG\cdot ZG}{BG\cdot CG}=\frac{3SG_{\triangle YZG}}{S_{\triangle ABC}}$
And using that
$S_{GYZ}=S_{GXZ}+S_{GXZ}$ I wrote
$$XG\cdot YG\cdot CG+XG\cdot ZG\cdot BG=2YG\cdot ZG\cdot DG$$
But I can't solve this problem. Can someone help me? Thanks for antetion!

Denote by $\ell$ the line through $X, Y, Z$. Define a function $f: \mathbb{R}^2 \to \mathbb{R}$ by $$ f(P) := \text{dist}(P, \ell). $$ It is easy to see that $f$ is linear (as a map of vector spaces). Since $G$ is the barycenter (centroid) of $\triangle ABC$, we have $3G = A + B + C = D + E + F$, and hence $$ f(D) + f(E) + f(F) = 3f(G). $$ By similar triangles, we have $XD/XG = f(D)/f(G)$, along with two other analogous relations. Therefore, $$ \frac{XD}{XG} + \frac{YE}{YG} + \frac{ZF}{ZG} = \frac{f(D)}{f(G)} + \frac{f(E)}{f(G)} + \frac{f(F)}{f(G)} = 3. $$
N.B. The quantities in the problem statement must be interpreted as signed lengths, e.g. the quantity $XD/XG$ is positive if the rays $\overrightarrow{XD}$ and $\overrightarrow{XG}$ point in the same direction and negative otherwise.