// Vejdoja Ilja Sipols
// Vide: Vizual Studio 2022

using System;

public class HelloWorld
{
    public static void Main(string[] args)
    {
        string persona = "ILJA SIPOLS";
        // Sadala mainīgo vārdu un uzvārdu
        string[] parts = persona.Split(' ');
        string vards = parts[0];
        string uzvards = parts[1];

        // Pārveido, lai tikai pirmais burts būtu lielais un pārēji mazie
        vards = char.ToUpper(vards[0]) + vards.Substring(1).ToLower();
        uzvards = char.ToUpper(uzvards[0]) + uzvards.Substring(1).ToLower();
        Console.WriteLine(vards);
        Console.WriteLine(uzvards);



        int rinda = 0;

        int kolona = 0;
        // šeit cikls parbaudā ja skaitls nav mazaks par 5
        while (rinda < 5)
        {
            Console.Write("Ievadi rindu skaitu, ne mazak ka 5: ");
            rinda = int.Parse(Console.ReadLine());
            if (rinda < 5)
            {
                Console.WriteLine("Nepareizi Ievaditi rindas skaits");
            }
        }

        while (kolona < 5)
        {
            Console.Write("Ievadi kolonu skaitu, ne mazak ka 5: ");
            kolona = int.Parse(Console.ReadLine());
            if (kolona < 5)
            {
                Console.WriteLine("Nepareizi ievaditi kolona skaits");
            }
        }

        string plusik = "+";
        string lin = "---";
        string palka = "|";


        for (int i = 1; i <= rinda; i++)
        {
            int tab = kolona - i;
            for (int g = tab; g > 0; g--)
            {
                Console.Write("    ");
            }
            for (int j = 0; j < i; j++)
            {

                Console.Write(plusik + lin);
            }
            Console.WriteLine(plusik);

            for (int g = tab; g > 0; g--)
            {
                Console.Write("    ");
            }
            for (int j = 0; j < i; j++)
            {

                Console.Write(palka + " " + (j + 1) + " ");

            }

            Console.WriteLine(palka);
        }


        // otra tabula
        for (int j = 0; j <= rinda - 1; j++)
        {
            Console.Write(plusik + lin);
        }
        Console.WriteLine(plusik);

        for (int i = 1; i <= rinda; i++)
        {
            
            for (int j = 0; j < i; j++)
            {

                Console.Write(plusik + lin);
            }
            Console.WriteLine(plusik);
            for (int j = 0; j < i; j++)
            {

                Console.Write(palka + " " + (j + 1) + " ");

            }

            Console.WriteLine(palka);
        }


        for (int j = 0; j <= rinda - 1; j++)
        {
            Console.Write(plusik + lin);
        }
        Console.WriteLine(plusik);
    }
}