Energy consumption in propelling the train is required for which of the following?

Energy consumption in propelling the train is required for which of the following?

A. Work against the resistance to motion
B. Work against gravity while moving up the gradient
C. Acceleration
D. All of the above