def reverse_middle_words(s):
lst = [s for s in s.split(' ')]
tmp = lst[0]
for i in range(1, len(lst) - 1):
tmp += " " + lst[i][::-1]
tmp += " " + lst[len(lst) - 1]
return tmp;
s = "c++ python java vb"
s = reverse_middle_words(s)
print(s)
'''
run:
c++ nohtyp avaj vb
'''