The numbers $1, 2,\ldots ,50$ are written on a blackboard. Ana performs the following operations: she chooses any three numbers $a, b$ and $c$ from the board and replaces them with their sum $a + b + c$ and writes the number $(a + b) (b + c) (c + a)$ in the notebook. Ana performs these operations until there are only two numbers left on the board ($24$ operations in total). Then, she calculates the sum of the numbers written down in her notebook. Let $M$ and $m$ be the maximum and minimum possible of the sums obtained by Ana. Find the value of $\frac{M}{m}$.