Artificial intelligent assistant

Given a network N, show that the resultant flow out of the sources is equal to the resultant flow into the sources. **_Problem:_** Let $f$ be a flow in a network $N = (V,X,Y,c)$ with vertice-set $V$, source-set $X$ and sink-set $Y$, and capacity function $c$ . Show that the resultant flow out of the sources is equal to the resultant flow into the sources. **_Thoughts:_** I know the resultant flow out of a sub-set of a network is equal to $f^{out}(X) - f^{in}(X)$ , (the negative of which is the resultant flow into a subset) and so the problem amounts to showing that $f^{out}(X) - f^{in}(X) = f^{in}(Y) - f^{out}(X)$. I am stuck and need a hint to progress as I am not sure where to begin.

Observe that we have $$ \sum_{v \in V} f^{out}(v) = \sum_{v \in V} f^{in}(v) \tag{$1$} $$ since the flow on each edge contributes the same amount to both the LHS and the RHS of $(1)$. In addition, by definition of a flow, we have $$ f^{out}(v) = f^{in}(v) \quad\text{for } \forall v \
ot \in X \cup Y \tag{$2$} $$ By $(1)$ and $(2)$, we then have $$ \sum_{v \in X \cup Y} f^{out}(v) = \sum_{v \in X \cup Y} f^{in}(v) $$ Since $X \cap Y = \emptyset$, the conclusion is immediate then.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6493a89df5a339869f531d0ba6a8ac6f