Optimal policies for multiechelon inventory problems with Markov-modulated demand