Controlling two inputs

Hi,
I am working on a project where two inputs will operate the relay. Both inputs are independent of each other. I am attaching a block diagram that illustrates two input(either high or low) and one output going to the relay. I am looking for a module that can select the most recent state of input. For example if input 1 and 2 were “high” in the beginning and next moment input 2 becomes “low”, output should be “low”.
Your help will be really appreciated …thanks a lot

aa.jpg

This post pretty much says nothing about what your trying to accomplish.

First thing to do is list all the input variations that you want and the corresponding output state required for each one.

Also will you need any states that cause the relay to latch or unlatch.