#include <stdio.h>
#include <stdlib.h>

typedef struct noh {
    int valor;
    struct noh *esquerda;
    struct noh *direita;
} no;

void espacos(int depth) {
    while (depth) {
        printf("   ");
        depth--;
    }
}

void desenha(no *arvore, int depth) {
    espacos(depth);
    if (arvore == NULL) {
        printf("-\n");
        return;
    }
    printf("%d\n", arvore->valor);
    desenha(arvore->esquerda, depth + 1);
    desenha(arvore->direita, depth + 1);
}

void arvbin(no *arvore) {
    desenha(arvore, 0);
}

int main() {
    no n1, n2, n3, n4, n5, n6;
    n1.valor = 555;
    n2.valor = 333;
    n3.valor = 888;
    n4.valor = 111;
    n5.valor = 444;
    n6.valor = 999;
    n1.esquerda = &n2;
    n1.direita = &n3;
    n2.esquerda = &n4;
    n2.direita = &n5;
    n3.esquerda = NULL;
    n3.direita = &n6;
    n4.esquerda = NULL;
    n4.direita = NULL;
    n5.esquerda = NULL;
    n5.direita = NULL;
    n6.esquerda = NULL;
    n6.direita = NULL;
    arvbin(&n1);
    return 0;
}