A triangle has a perimeter of 40cm. If the three sides of the triangle are n, 3n−5, and 3n−4, what is the length of each side?