beautify input and output