reading input and output