Format input and output