=LET(
f, FILTER(A2:J2,A2:J2<>""),
s, SEQUENCE(COLUMNS(f)/2,2),
v, INDEX(f,,s),
x, INDEX(v,,1),
y, INDEX(v,,2),
u, UNIQUE(FILTER(v,MMULT((x=TRANSPOSE(x))*(y=TRANSPOSE(y)),IF({1},1,x))>1,"")),
n, SEQUENCE(COUNTA(u),,0),
TRANSPOSE(INDEX(u,INT(n/2)+1,MOD(n,2)+1))
)
=LET(
f, FILTER(A2:J2,A2:J2<>""),
s, SEQUENCE(COLUMNS(f)/2,2),
v, INDEX(f,,s),
x, INDEX(v,,1),
y, INDEX(v,,2),
u, UNIQUE(FILTER(v,MMULT((x=TRANSPOSE(x))*(y=TRANSPOSE(y)),IF({1},1,x))>1,"")),
n, SEQUENCE(COUNTA(u),,0),
TRANSPOSE(INDEX(u,INT(n/2)+1,MOD(n,2)+1))
)
=LET(
f, FILTER(A2:J2,A2:J2<>""),
s, SEQUENCE(COLUMNS(f)/2,2),
u, UNIQUE(INDEX(f,,s),,TRUE),
n, SEQUENCE(COUNT(u),,0),
TRANSPOSE(INDEX(u,INT(n/2)+1,MOD(n,2)+1))
)