print sorted result