If you were working with a flat rectangle and you were given the diagonal, you'd want to use the Pythagorean theorem to choose two sides whose squares would add up to the square of the diagonal.
It works exactly the same with a 3-D box. We need three dimensions for the box, whose squares add up to the square of the diagonal between opposite corners. That's (4)² = 16.
So (L)² + (W²) + (H²) = 16 . From there, you're completely free to pick any numbers you want, just as long as their squares add up to 16. There are an infinite number of possibilities. Here are a few: