You need three formulas: the present value of an annuity, the future value of an annuity, and the compound interest formula for a single amount. You could get away with just one of the first two formulas.
You basically have to gather all the money to one time, so that you can move, add and subtract it.
A)Find the present value of the 12 3000 payments (as of 1 year before the first 3000 payment)
B) Find the present value of the 8 5000 payments (as of 1 year before the first 5000 payment)
C) Bring B) 12 years earlier by dividing by $1.10^{12}$
A) + C) is the original amount of the loan
Now to find the debt immediately after the 9th payment.
D) Move the original loan forward 9 years by multiplying by $1.1^{9}$
E) Find the future value of the first nine payments of 3000, as of immediately after the 9th payment and subtract from D). This is the amount owing after the 9th payment. Multiply by 0.10 to find the interest portion of the 10 payment.
The second part is slightly more complicated. You need to move the original debt to Payment 14, accumulate the 12 small payments and then move them to Payment 14, and then find the future value of the first two big payments...