#include<stdio.h>
#include<string.h>
#include<ctype.h>
void reverse_word(char *word){
    int len=strlen(word);
    int start=0,end=len-1;
    while(start<end){
        char temp=word[start];
        word[start]=word[end];
        word[end]=temp;
        start++;
        end--;
    }
}
void decode_message(char *s){
    char *word=strtok(s,"");
    while(word!=NULL){
        reverse_word(word);
        printf("%a",word);
        word=strtok(NULL,"");
    }
    printf("\n");
}
int is_valid_input(char *s){
    for(int i=0;a[i];i++){
        if(!isalpha(s[i])&&s[i]!=''){
            return 0;
        }
    }
    return 1;
}
int main(){
    char s[101];
    printf("Enter a message:");
    fgets(s,sizeof(s),stdin);
    a[strcspn(a,"\n")]=0;
    if(strlen(s)<1||strlen(s)>100){
        printf("Invalid input\n");
    }else if(!is_valid_input(s)){
        printf("Invalid input\n");
    }else{
        decode_message(s);
    }
    return 0;
}