Swap first and last characters of a given word