class Arbre {
    int indice;
    Foret suiv;
    Arbre (int i, Foret f){
        indice = i; suiv = f; }
}

class Foret {  // une liste d'arbres
    Arbre prem;
    Foret reste;
    Foret (Arbre a, Foret f){
        prem = a;
        reste = f; }
}

class Affiche extends MacLib {

    public static void init () {
        InitQuickDraw();
        Rect r = new Rect(100,100,420,420);
        setDrawingRect(r);
        showDrawing();
    }

    public static int affiche (int x, int y, Arbre a){
        int nx=x;
        Foret f;
        if (a==null)
            return x;
        else {
            f = a.suiv;
            while (f!=null) {
                nx=affiche(nx,y+10,f.prem)+10;
                f=f.reste;
            }
            moveTo((x+nx)/2,y);
            drawString(String.valueOf(a.indice));
            return nx;
        }
    }
}
            
