static void Main(string[] args) { Message <string> g = new Message <string>(); g.Field1 = "Obligation:"; g.Field2 = "Your money:"; Tc Galery = new Tc("Galery"); Console.WriteLine("\n\nMAGAZINE:"); Galery.Magazine = new Shawerma(); Galery.Raschet(Galery.Magazine); Galery.Info(Galery.Magazine); Galery.Magazine = new Products(); Galery.Raschet(Galery.Magazine); Galery.Info(Galery.Magazine); Console.WriteLine("\n\nSTUFF:"); Galery.Stuff = new Toilet(); Galery.Raschet(Galery.Stuff); Galery.Info(Galery.Stuff); Galery.Comparer(Galery.CompareTo(Galery.Stuff)); Galery.Stuff = new Electro(); Galery.Raschet(Galery.Stuff); Galery.Info(Galery.Stuff); Galery.Comparer(Galery.CompareTo(Galery.Stuff)); Galery.Stuff = new Security(); Galery.Raschet(Galery.Stuff); Galery.Info(Galery.Stuff); if (Galery.AllMoney < 0) { Console.WriteLine(g.Field1 + Galery.AllMoney); } else { Console.WriteLine(g.Field2 + Galery.AllMoney); } }