write to output