=CONCAT(IF(ISNUMBER(SEARCH(B1, SPLIT(A1, " "))),
INDEX(SPLIT(A1, " "), MAX(1, MATCH(B1, SPLIT(A1, " "), 0) - 10)) & " ", "")) &
B1 & " " &
CONCAT(IF(ISNUMBER(SEARCH(B1, SPLIT(A1, " "))),
INDEX(SPLIT(A1, " "), MIN(COUNTA(SPLIT(A1, " ")), MATCH(B1, SPLIT(A1, " "), 0) + 10)) & " ", ""))