A wire is first bent into the shape of a rectangle with width 8 cm and 10 cm length. Then the wire is unbent and reshaped into a square. What is the length of a side of the square?