#include<stdio.h>

#include<string.h>

#define MAXLINE 50

void reverse (char slovo[])

  {

    int len = strlen(slovo);

    char dr_slovo[len];

      for (int i = 0; i < len; ++i)
        {
            dr_slovo[len-1-i] = slovo[i];
        }
    printf ("%s\n", dr_slovo);
  }

int main()

{ 

  int slovo;

  char word[MAXLINE];

  int i = 0;

  while(slovo = getchar())

    {

      if (slovo == -1)
        break;
      else if (slovo == '\n')
        {
          reverse(word);
          i = 0;
        }
      else
        {
          word[i] = /*putchar*/(slovo);
           ++i;
        }
    }  
  return 0;
 
}
