How is the underlined pronoun used in the sentence?

Who was the eighth president of the United States?

A.
direct object

B.
object of a preposition

C.
subject