#include <stdio.h>
#include <stdlib.h>

#define BUFFER_SIZE 512

void tac()
{
    char data[BUFFER_SIZE];
    int eof = !fgets(data, BUFFER_SIZE, stdin);
    char *p, *q;

    if (!eof)
	tac();

    for (p = data; *p; p++);

    for (p--, q = data; q < p; p--, q++) {
	char xchg = *p;
	*p = *q;
	*q = xchg;
    }
    fputs(data, stdout);
}

int main()
{
    tac();
    return EXIT_SUCCESS;
}