Japan's economy has unexpectedly shrank in the third quarter. The impact of high inflation, weak yen, and the soaring price of commodities have weighed on the country.