Japan factory output rises