Japan's factory output shrank for the first time in three months in December as a decline in machinery production outweighed…