#include <stdio.h>
#include <stdlib.h>
typedef struct BinTree
{
struct BinTree*left;
struct BinTree*right;
char val;
}BT;
BT* Creater_Tree(char* buff,int* pi)//递归构建二叉树
{
if(buff[*pi]=='#')
{
(*pi)++;
return NULL;
}
BT*Treenode = (BT*)malloc(sizeof(BT));
Treenode->val = buff[(*pi)++];
Treenode->left = Creater_Tree(buff,pi);
Treenode->right = Creater_Tree(buff,pi);
return Treenode;
}
void In_Post(BT*root)
{
if(root==NULL)
return;
In_Post(root->left);
printf("%c ",root->val);
In_Post(root->right);
}
int main()
{
int i = 0;
char str[100];
scanf("%s",str);
BT*root = Creater_Tree(str,&i);
In_Post(root);
return 0;
}