They are all grammatically correct. No preposition would produce a grammatically incorrect sentence. However, with some prepositions it might be quite difficult to figure out a meaning.
Perhaps with some difficulty I can imagine a context for every single one of your six sentences that makes sense. However, I have the most trouble imagining such a context for "in". Since that is the hardest one for me to defend, I accept the challenge:
"Tom planned to spend the evening studying English. His plan was to spend 15 minutes on verbs, 15 minutes on words (vocabulary), and 15 minutes on grammar. First he did the verbs. Then he did the grammar. But then he ran into unexpected difficulty with the third piece. He was stumped in words (meaning he was stumped in that category). He had never before seen so many words containing the letter 'z'!"