def f(slv):
newslv=''
for i in range(len(slv)-1,-1,-1):
newslv+=slv[i]
return newslv
print(f('tima'))
slova='tima depresivnuy huy'
pred=0
for i in range(len(slova)):
if slova[i]==' ':
print(f(slova[pred:i]),end=' ')
pred=i+1
print(f(slova[pred:len(slova)]),end=' ')
ZGVmIGYoc2x2KToKICAgIG5ld3Nsdj0nJwogICAgZm9yIGkgaW4gcmFuZ2UobGVuKHNsdiktMSwtMSwtMSk6CiAgICAgICAgbmV3c2x2Kz1zbHZbaV0KICAgIHJldHVybiBuZXdzbHYKcHJpbnQoZigndGltYScpKQpzbG92YT0ndGltYSBkZXByZXNpdm51eSBodXknCnByZWQ9MApmb3IgaSBpbiByYW5nZShsZW4oc2xvdmEpKToKICAgIGlmIHNsb3ZhW2ldPT0nICc6CiAgICAgICAgcHJpbnQoZihzbG92YVtwcmVkOmldKSxlbmQ9JyAnKQogICAgICAgIHByZWQ9aSsxCnByaW50KGYoc2xvdmFbcHJlZDpsZW4oc2xvdmEpXSksZW5kPScgJyk=