A solution by hand:
First, the minimum sum in the upper-left loop is 2+3+4+5 = 14, so X >= 14.
The maximum product in the bottom is $3*6*7*8$ = 1008
The product includes at least 1 power of 3, at most 2 powers of 3, and at most 1 power of 5, and no primes greater than 7.
$14*15$ = $2*3*5*7$, maybe
$15*16$ = $2^4 *3*5$, maybe
$16*17$ includes 17, no
$17*18$ includes 17, no
$18*19$ includes 19, no
$19*20$ includes 19, no
$20*21$ = $2^2 * 3 * 5 * 7$, maybe
$21*22$ includes 11, no
$22*23$ includes 11 and 23, no
$23*24$ includes 23, no
$24*25$ includes two powers of 5, no
$25*26$ includes 13 and 2 powers of 5, no
$26*27$ includes 13 and 3 powers of 3, no
$27*28$ includes 3 powers of 3, no
$28*29$ includes 29, no
$29*30$ includes 29, no
$30*31$ includes 31, no
$31*32$ includes 31, no
$32*33$ > 1008, too big.
So X is 14, 15, or 20. If X=14 or X=15, then the upper-left loop requires 2,3,4,5 or 2,3,4,6, and the upper right loop will be too big. So X=20, and the bottom loop has 3,4,5,7.
The right loop must have 3, one of (4,5,7), and two of (2,6,8) that sums to 21. To have an odd sum, it must use the 4. The other two digits sum to 14, so must be 6,8.
The left loop must have 3, one of (5,7), and two of (2,6,8) that sums to 20. The only way to do that is 3,7,2,8.
Now that it's known which digits fall in each loop, the exact placement is straightforward.