assuming the force F is exerted on car C and nearest to C is car B and remaining one is A.
[tex]\vec{F}_{A}[/tex] is total sum of all (interbody-) forces on car A . similarly [tex]\vec{F}_{B}[/tex] and [tex]\vec{F}_{C}[/tex] are defined.

assuming the forces that the question asks is [tex]\vec{F}_{A}[/tex],[tex]\vec{F}_{B}[/tex] and [tex]\vec{F}_{C}[/tex] and the given information is
$$\vec{F}_{CO}=\vec{F}$$

according to newton's 2nd law
$$\vec{F}_{A}=\frac{d^{2}}{dt^{2}}m\vec{r}_{A}$$,
$$\vec{F}_{B}=\frac{d^{2}}{dt^{2}}m\vec{r}_{B}$$ and
$$\vec{F}_{C}=\frac{d^{2}}{dt^{2}}m\vec{r}_{C}$$

but since
$$\frac{d^{2}}{dt^{2}}\vec{r}_{A}=\frac{d^{2}}{dt^{2}}\vec{r}_{B}=\frac{d^{2}}{dt^{2}}\vec{r}_{C}$$, $$\frac{d}{dt}m =0$$

so above five equations would give
$$\vec{F}_{A}=\vec{F}_{B}=\vec{F}_{C}$$

according to superposition principle,
$$\vec{F}_{A}=\vec{F}_{AB}$$
because there is only one force i.e tension force due to string, exerted on A.
$$\vec{F}_{B}=\vec{F}_{BA}+\vec{F}_{BC}$$
because two tension forces (from both A and C) is acting on B.
$$\vec{F}_{C}=\vec{F}_{CO}+\vec{F}_{CB}$$
because one external force of magnitude F and one tension force from B.

according to 3rd law we also have,
$$\vec{F}_{AB}=-\vec{F}_{BA}$$ and
$$\vec{F}_{BC}=-\vec{F}_{CB}$$.

so from above five equations,
$$\vec{F}_{A}+\vec{F}_{B}+\vec{F}_{C}=\vec{F}_{CO}$$
hence
$$\vec{F}_{A}=\vec{F}_{B}=\vec{F}_{C}=\frac{\vec{F}}{3}$$
but i dont undertand why its wrong because the solution says
$$\vec{F}_{A}=\frac{\vec{F}}{3}$$,
$$\vec{F}_{B}=\frac{2\vec{F}}{3}$$ and
$$\vec{F}_{C}=\vec{F}$$

the only problem think i can think of is may be the question is asking for different forces , because there are forces that have same value for example ,
$$\vec{F}_{A}=\frac{\vec{F}}{3}$$,
$$\vec{F}_{BC}=\frac{\vec{2F}}{3}$$,
$$\vec{F}_{C0}=\vec{F}$$

The question is not asking for the net force on each car, which of course must be equal. It is asking for the force that C exerts on B and B exerts on A in terms of the force F that the locomotive exerts on C.