enum Graph {
    Node(i32, Vec<Graph>),
}
use Graph::Node;

fn main() {
    let graph = Node(0, vec![
        Node(1, vec![]),
        Node(2, vec![
            Node(3, vec![]),
            Node(4, vec![]),
        ]),
    ]);

    fn visit(graph: &Graph) {
        match graph {
            Graph::Node(value, edges) => {
                println!("{value}");
                for edge in edges {
                    visit(edge);
                }
            }
        }
    }

    visit(&graph);
}