John invests a total of $\$10000$ in two different funds. One fund offers a rate of return of 3% per year, and the other offers a rate of return of 5% per year. If his total earnings from the investments after one year are $\$420$, how much did he invest in each fund? Let's think step by step and output the final answer within \boxed{}.
user