From a point 18 feet from the base of a tower, a wire is stretched to an attachment 40 feet up the tower. A right triangle with legs of 18 ft and 40 ft. To the nearest foot, how long is the wire?