The function f(x) takes a word as input and returns 1 if the word is a city, a political leader, or a fruit, and 0 otherwise.

