John invested his inheritance of $12,000 in three different funds: part in a money-market fund paying 3% interest annually; part in municipal bonds paying 4% annually, and the rest in mutual funds paying 7% annually. John invested $4,000 more in mutual funds than he invested in municipal bonds.The total interest earned in one year was $670. How much did he invest in each type of fund?