#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;
int ac=0;
void reverseString(string a,int count)
{
if(count==a.length())
{
for(int g=ac-1;g<a.length();g++)
cout<<a[g];
}
else if(a[count]!=' '&&count<a.length())
{
ac++;
reverseString(a,count+1);
}
else if(a[count]==' ')
{
reverseString(a,count+1);
ac-=count;
for(int g=ac+1;g<count;g++)
cout<<a[g];
if(ac!=-1)
cout<<" ";
}
}
int main()
{
string a,b;
a="How are you";
reverseString(a,0);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPGNzdHJpbmc+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBhYz0wOwp2b2lkIHJldmVyc2VTdHJpbmcoc3RyaW5nIGEsaW50IGNvdW50KQp7CiAgICBpZihjb3VudD09YS5sZW5ndGgoKSkgCiAgICB7CiAgICAgICAgZm9yKGludCBnPWFjLTE7ZzxhLmxlbmd0aCgpO2crKykKICAgICAgICAgICAgY291dDw8YVtnXTsKICAgIH0KICAgIGVsc2UgaWYoYVtjb3VudF0hPScgJyYmY291bnQ8YS5sZW5ndGgoKSkKICAgICAgICB7CiAgICAgICAgICAgIGFjKys7CiAgICAgICAgICAgIHJldmVyc2VTdHJpbmcoYSxjb3VudCsxKTsKICAgICAgICB9CiAgICBlbHNlIGlmKGFbY291bnRdPT0nICcpCiAgICAgeyAgCiAgICAgICAgICAgIHJldmVyc2VTdHJpbmcoYSxjb3VudCsxKTsKICAgICAgICAgICAgYWMtPWNvdW50OwoKICAgICAgICBmb3IoaW50IGc9YWMrMTtnPGNvdW50O2crKykKICAgICAgICAgICAgY291dDw8YVtnXTsKICAgICAgICBpZihhYyE9LTEpCiAgICAgICAgICAgIGNvdXQ8PCIgIjsKICAgICB9Cn0KaW50IG1haW4oKQp7CiAgICBzdHJpbmcgYSxiOwogICAgYT0iSG93IGFyZSB5b3UiOwogICAgcmV2ZXJzZVN0cmluZyhhLDApOwogcmV0dXJuIDA7ICAgCn0K