The function implemented by f(x) takes a string input and replaces certain words with their reversals.
