#Bash, 179 bytes
Bash, 179 bytes
echo U`sed -r 's/./& &/g'<<<HAABADEDOEFAEHELAGOFEMAHINAISHMENERESITALOHOMMONOPAMUMYAWETOSOWOYOXUNUPEXI`F `grep -o ..<<<ANARASATAXAYBEBIBOBYJOKAKILIMIOIDOIDORPIQITIUSUTYEZA`
- Saved 7 bytes thanks to Adam Katz comment
It uses sed
to do regex replacement. First regex input is based on Sp3000 idea while second regex uses common input without spaces.
Explanation:
echo print to standard output the following
U boundary U character
sed -r [etc] the result of replacing regex
. select a character
& & replace it for: matched char, space, matched char
g do it globaly for every character
<<<HAAB[etc] string input based on Sp3000 idea => HA AA AB ...
F boundary F character
sed -r [etc] the result of replacing regex
.. every two characters
<space>& for space+matched character
g do it globally
<<<ANAR normal input => AN AR ...