#include <stdio.h>
#include <string.h>

#define MAXNAME 128
struct node
{ // ２分木のノード
    struct node *left, *right; // 左と右の分岐を示すポインタ
    char name[MAXNAME]; // ノードの名前（関数名，変数・定数名）
};

void print_tree(struct node *nd)
{
    if ((nd->left == NULL) && (nd->right == NULL)) {
        printf(" %s",nd->name);
        return;
    }
    printf("(%s ",nd->name);
    if (nd->left != NULL) print_tree(nd->left);
    if (nd->right != NULL) print_tree(nd->right);
    printf(")");
}

//  下の式を入力する
//         ＋
//        ／＼
//　　　−   1.0
//　　／＼
//  3.4  1.6 
main()
{
    struct node nd[10];
    struct node *root,*current;
    int ct=0;
    root = nd;
    ct++;
    /* initialization */
    strcpy(root -> name,"+");
    current = root -> right = nd+ct;
    ct++;
    strcpy(current -> name,"1.0");
    current -> left = NULL;
    current -> right = NULL;
    current = root -> left = nd+ct;
    ct++;
    strcpy(current -> name ,"-");
    current = root -> left -> left = nd+ct;
    ct++;
    strcpy(current -> name,"3.4");
    current -> left = NULL;
    current -> right = NULL;
    current = root -> left -> right = nd+ct;
    ct++;
    strcpy(current -> name,"1.6");
    current -> left = NULL;
    current -> right = NULL;
    print_tree(root);
    putchar('\n');
}
