#include <iostream>
#include <bits/stdc++.h>
using namespace std;
string Reverse(string a)
{
if(a.size()==0)return "";
string ans=a[a.size()-1]+Reverse(a.substr(0,a.size()-1));
return ans;
}
/*
int getd(tree *root)
{
if(root==NULL)return 0;
int l=getd(root->left)+1;
int r=getd(root->right)+1;
int d=l>r?l:r;
return d;
}*/
int main()
{
string a="1234";
cout<<Reverse(a)<<endl;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
string Reverse(string a)
{
if(a.size()==0)return "";
string ans=a[a.size()-1]+Reverse(a.substr(0,a.size()-1));
return ans;
}
/*
int getd(tree *root)
{
if(root==NULL)return 0;
int l=getd(root->left)+1;
int r=getd(root->right)+1;
int d=l>r?l:r;
return d;
}*/
int main()
{
string a="1234";
cout<<Reverse(a)<<endl;
return 0;
}