A cylinder rolls up an inclined plane, reaches some height, and then rolls down (without slipping throughout these motions). The directions of the frictional force acting on the cylinder are.
A. Up the incline while ascending and down the incline while descending
B. Up the incline while ascending as well as descending
C. Down the incline while ascending and up the incline while descending
D. Down the incline while ascending as well as descending