#include "iostream"
using namespace std;
#define MAX 20
char str[MAX];
//打印字符串
void printf_str(char* str,int order);
int main(void)
{
fgets(str,MAX,stdin);
//cout<<str<<endl;
printf_str(str,0);
return 0;
}
/*
str ;//字符数组
order = 0;正序打印
order = 1;倒序打印
*/
void printf_str(char* str,int order)
{
int len;
if (str == NULL)
{
return;
}
len = strlen(str);
if (len == 1)
{
return;
}
if (len == 2)
{
cout<<str[0]<<endl;
}
else
{
if (!order) //0正序
{
cout<<str[0]<<endl;
}
printf_str(str + 1,order);
if (order)
{ //1倒序
cout<<str[0]<<endl;
}
}
return;
}