#include <stdio.h>
#include <string.h>

int main()
{
    char str[1000] = {0};
    scanf("%s", str);
    int len = strlen(str);
    char *out = NULL;
    out = (char *)malloc(len);
    memset(out, 0, len+1);
    for(int i = 0; i < len; i++)
    {
        if(str[i] >= 'a' && str[i] <= 'z')
        {
            out[len-1-i] = str[i];	//把输入字符串的头字符放在输出的尾部
        }
    }
    out[len] = '\0';
    printf("%s\n", out);
    if(out)
    {
        free(out);
        out = NULL;
    }
    return 0;
}