using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Program { internal class Doboz { public char Type { get; set; } public Doboz Children = null; public Doboz Parent = null; public Doboz(char Type) { this.Type = Type; } public void AddChildren(Doboz doboz) { doboz.Parent = this; this.Children = doboz; } public void PrintBoxContent(int indent = 0) { string indentStr = ""; for (int i = 0; i < indent; i++) { indentStr += "->"; } Console.WriteLine($"{indentStr}{this.Type}"); if (this.Children != null) { this.Children.PrintBoxContent(indent + 1); } } } }