Chemical Transformations in Ultrathin Chalcogenide Nanowires