Casey poured sand into a box measuring 4 inches by 16 inches by 8 inches until it was completely full. She then dumped all the sand into a plastic cube and discovered that the cube held the exact same amount of sand. In inches, how long was the edge of the cube?