Mary won a contest in which she is paid $5000 today and $8000 at the end of year 6. She deposited the money she gets today and the end of year 6 into a savings account which earns 10% interest. If she wants to withdraw an amount x at the end of each year for the first 6 years and then x+500 each year for years 7-12, what is the value of x?