Let's use the variable x to represent the length of the shortest side.
One side is 3 times longer than this side, so it measures "3x"
The third side is 4 cm longer, so it measures "x + 4".
If the perimeter is 39, we have:

So the shortert side measures 7 cm.