Bob deposits $X at the end of each year for 20 years into an account earning an effective annual rate of 4%. At the end of year 20, he transfers the accumulated amount to an account earning a nominal rate of 6% compounded monthly. He withdraws $500 at the end of each month from the account for 15 years. Find the amount $X that makes this possible (so that he has $0 remaining at the end of 35 (the 20 plus the 15) years).