output in required format