The numbers $1,2,\ldots,49,50$ are written on the blackboard. Ann performs the following operation: she chooses three arbitrary numbers $a,b,c$ from the board, replaces them by their sum $a+b+c$ and writes $(a+b)(b+c)(c+a)$ to her notebook. Ann performs such operations until only two numbers remain on the board (in total 24 operations). Then she calculates the sum of all $24$ numbers written in the notebook. Let $A$ and $B$ be the maximum and the minimum possible sums that Ann san obtain. Find the value of $\frac{A}{B}$. (I. Voronovich)