Given a triangle with perimeter 63 cm, one side of which is 21 cm, and one of the medians is perpendicular to one of its angle bisectors. Find the lengths of all sides of the triangle.