Think about the way the multiplexer works. It takes a 3 bit code and uses that to select one of the 8 inputs, which will appear at the output. Think about arranging the inputs to give the correct output for the selection input.