Choose the correct case of each noun, looking at the context of the sentence and the preposition, if there is one.