To get that exact result, you can use:
=ARRAYFORMULA(
LET(unpv,SPLIT(TOCOL(A3:A5&"|"&B2:D2&"|"&B3:D5),"|"),
fc,INDEX(unpv,,1),
rws,SEQUENCE(ROWS(fc)),
{IF(COUNTIFS(fc,fc,rws,"<="&rws)>1,,fc),CHOOSECOLS(unpv,2,3)}))
However, you may be interested in this as well:
=ARRAYFORMULA(SPLIT(TOCOL(A3:A5&"|"&B2:D2&"|"&B3:D5),"|"))