The length of the hypotenuse of a right-angled triangle exceeds the length of the base by 2 cm and exceeds twice the length of the altitude by 1 cm. Find the length of each side of the triangle.