enum Tag {PLUS, INT, FLOAT};
typedef enum Tag tag;

struct Exp {
  tag tag;
  union {
    struct {
      struct Exp* left;
      struct Exp* right;
    } sum;
    int n;
    float f;
  } info;
};

typedef struct Exp exp;

void print (exp* e) {
  switch (e->tag) {
  case PLUS:
    print_exp(e->info.sum.left);
    printf("+");
    print_exp(e->info.sum.right);
    break;
  case INT:
    printf("%d", e->info.n);
    break;
  case FLOAT:
    printf("%f", e->info.f);
    break;
  }
}
