printing outputs into file