A string of length $40$ meters is divided into three parts of different lengths. The first part is three times the second part, and the last part is $23$ meters smaller than the first part. Find the length of the largest part