Qian used the rule "Divide the length of a piece of wood by 3 to get the number of nails needed." If three nails are needed for a piece of wood that is 9 inches and 13 nails are needed for a piece of wood that is 39 inches, what is the length of a piece of wood that uses 8 nails?