The two solid shafts and gears shown are used to transmit $16 \mathrm{hp}$ from the motor at $A$ operating at a speed of $1260 \mathrm{rpm}$ to a machine tool at $D$. Knowing that the maximum allowable shearing stress is $8 \mathrm{ksi}$, determine the required diameter of (a) shaft $A B,(b)$ shaft $C D$.