using System.Collections.Generic;
public IList<Node> children;
public Node(int _val,IList<Node> _children) {
public static void Main()
children = new List<Node>() {
children = new List<Node>() {
var solution = new Solution();
Console.WriteLine(solution.MaxDepth(tree));
public int MaxDepth(Node root) {
var list = new List<int>() { 0 };
if (root.children != null) {
foreach (var item in root.children){
list.Add(MaxDepth(item));