5. In the reference frame associated with Gavrila, the balls are thrown upwards from the same point with the same speed at intervals of $\tau$ in time. By introducing the $y$-axis, directed vertically upwards with its origin at the point of throwing, and measuring time from the moment the first ball is thrown, we can write the equations of motion for both balls:

$$
y_{1}(t)=U t-\frac{g t^{2}}{2}, \quad y_{2}(t)=U(t-\tau)-\frac{g(t-\tau)^{2}}{2}
$$

where the latter relation is relevant to the problem for $t \geq$ $\tau$. The distance between the balls $s(t)=\left|y_{1}(t)-y_{2}(t)\right|=\mid U \tau-g t \tau+$ $\left.\frac{g \tau^{2}}{2} \right\rvert\,$. We need to find the minimum of this function.

If $2 U \geq g \tau$, there is a value $T=\frac{\tau}{2}+\frac{u}{g} \geq \tau$, at which $s(T)=0$, which is clearly the smallest distance between the balls. Since the interval $\tau$ is small by condition, we will assume that the required inequality is satisfied.

In the considered reference frame, Glafira is moving away from the point of throwing and the line along which the balls fly with a speed $V$, so by the time the balls meet, the distance between her and the balls will be $V T=V\left(\frac{\tau}{2}+\frac{u}{g}\right)$.
Answer: Minimum distance 0, at a distance of $V\left(\frac{\tau}{2}+\frac{u}{g}\right)$ from Glafira.