A certain number of boys and girls wait for the bus. In the first bus that passes at the point where they are, only fifteen girls board and two boys remain for each girl at the bus stop. In the second bus that passes, only 45 boys board and five girls remain for each boy at the bus stop. Determine the number of boys and girls who were at the stop before the first bus passed.
Let $M$ represent the number of girls and $H$ the number of boys who were at the bus stop before the first bus arrived. After 15 girls boarded the first bus, $M-15$ girls and $H$ boys remained at the stop. Since at this point, there were two boys for every girl at the stop, we have $H=2(M-15)$. In the second bus, 45 boys boarded, leaving $M-15$ girls and $H-45$ boys at the stop. Since at this moment, there were five girls for every boy at the stop, we have $M-15=5(H-45)$. Thus, we obtain the system of linear equations

$$
\left\{\begin{array}{r}
H=2(M-15) \\
M-15=5(H-45)
\end{array}\right.
$$

Substituting the first equation into the second, we get $M-15=5(2 M-30-45)=$ $10 M-375$.

Therefore, $9 M=360$, so $M=40$ and $H=2(40-15)=50$.