#include<iostream>
#include<math.h>
using namespace std;
char *Fun(char temp[])
{
int len = strlen(temp);
//cout<<len<<endl;
for(int i = 0, j = len - 1; i <= j; i++, j--)
{
char temp1 = temp[j];
temp[j] = temp[i];
temp[i] = temp1;
}
//
int j, k, p = 0;
for(int i = 0; i < len - 1; i++)
{
if(temp[i] == ' ')
{
for(k = p, j = i - 1; k <= j; k++, j--)
{
char temp1 = temp[k];
temp[k] = temp[j];
temp[j] = temp1;
}
p = i + 1;
}
}
return temp;
}
void main()
{
char str[100];
gets(str);
cout<<Fun(str)<<endl;
system("pause");
}