Name this triangle ABC, where A is the angle divided into equal parts by bisector AD and point B lies under the bisector AD and point C lies over the bisector AD.
According to the bisector theorem:

.
On the picture CD=q and BC=16, then BD=16-q.
The previous ratio becomes:

.
Answer: q=9