A $1000 loan was made at 15% interest compounded quarterly. The loan will be repaid with payments of $400 at the end of the first quarter, $6090 at the end of the fifth year, and the remaining balance at the end of the tenth year. The question is to calculate the amount of the final payment.