An electromechanical surgical device includes an end effector (400) configured to perform at least one function, the end effector including an input drive axle (426) projecting therefrom; and a shaft assembly (200). The shaft assembly includes a rotatable drive shaft (214); a proximal neck housing (232) supported at a distal end of an outer tube (210); a distal neck housing (236) pivotally connected to the proximal neck housing; a pivot pin (234) interconnecting the proximal neck housing and the distal neck housing; and a gear train (238) supported in the proximal neck housing, on the pivot pin, and in the distal neck housing. The gear train includes a proximal gear (238a); an intermediate gear (238b); a distal gear (238c); and a pair of output gears (239a, 239b), wherein each output gear defines a coupling socket (239a1, 239b1) each configured to selectively receive the drive axle of the end effector.