A genie offers to make you fluent in twenty or a hundred languages, living or dead. How do you choose?
The greedy algorithm: add whatever language most increases the number of people, living or dead, with whom you could have (had) a fluent conversation; repeat.
Alternately, the language preferred by the most recent ancestor with whom you cannot already converse; repeat. (Closely related dialects come at a discount.)
But I’d trade some slots on either of these lists for some smaller languages of historical or literary interest, such as Etruscan and perhaps Volapük, plus sign languages (ASL, Plains, BSL).