#include<stdio.h>
#include<string.h>
int main(void)
{
        char msg[256],invert[256],word[256],invword[256];
        int i,j,k,l,m,n;
        gets(msg);
        n=strlen(msg);
        for(i=0,j=n-1;i<n;i++,j--)
                                  invert[j]=msg[i];
        invert[i]='\0';
        for(i=0;i<n;i++){
                         j=0;
                         while(invert[i]!=' '){
                                           word[j]=invert[i];
                                           j++;
                                           i++;
                         }
                         word[j]='\0';
                         m=strlen(word);
                         for(j=0,k=m-1;j<m;j++,k--)
                                                   invword[j]=word[k];
                         invword[j]='\0';
                         printf("%s ",invword);
                         }
        printf("\n");
return 0;
}


