So in the most simplest terms, I have 2 inputs A and B, and 2 outputs A' and B'. A usually outputs A' and B usually outputs B', except for the case when both A and B are high. Very simple truth table, the only interesting thing is the last row:

A | B | A' | B' |

0 | 0 | 0 | 0 |

0 | 1 | 0 | 1 |

1 | 0 | 1 | 0 |

1 | 1 | * | * |

__*When A and B are both high, exactly one of A' or B' should be high, and it should be the corresponding input that became high most recently.__If both A and B became high at exactly the same time, then the circuit can just bias towards one, I'm not too worried about this case.

So the question is, how would I build a simple circuit like this? I'm using the 4021 8-Stage Shift Register as the base of my controller, with the inputs of my buttons feeding into this. I'd like it to be as simple as possible, probably using a few logic gates and latches.