using System;
using System.Linq;

namespace CodeForces
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			string line1 = Console.ReadLine();
			int n = Int32.Parse(line1);
			int[,] columns = new int[11 , 4];
			if (n >= 4)
			{
				n -= 4;
				for (int i = 0; i < 4; i++)
				{
					columns[0, i] = 1;
				}
				int column = 1;
				int row = 0;
				while (n > 0)
				{
					n -= 1;
					columns[column, row] = 1;
					row += 1;
					if (row == 2)
					{
						row += 1;
					}
					if (row == 4)
					{
						row = 0;
						column += 1;
					}
				}
			}
			else
			{
				if (n == 3)
				{
					for (int i = 0; i < 3; i++)
					{
						columns[0, i] = 1;
					}
				}
				else if (n == 2)
				{
					for (int i = 0; i < 2; i++)
					{
						columns[0, i] = 1;
					}
				}
				else if (n == 1)
				{
					for (int i = 0; i < 1; i++)
					{
						columns[0, i] = 1;
					}
				}
				else
				{

				}
			}
			Console.WriteLine("+------------------------+");
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 0] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("#.");
				}
			}
			Console.Write("|D|)" + Environment.NewLine);
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 1] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("#.");
				}
			}
			Console.Write("|.|" + Environment.NewLine);
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 2] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					if (i == 0)
					{
						Console.Write("#.");
					}
					else
					{
						Console.Write("..");
					}

				}
			}
			Console.Write("..|" + Environment.NewLine);
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 3] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("#.");
				}
			}
			Console.Write("|.|)" + Environment.NewLine);
			Console.WriteLine("+------------------------+");

		}

	}

}

using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;

namespace work01
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			var n = Int32.Parse (Console.ReadLine ());

			var l1 = n > 4 ? (n + 1) / 3 : n > 0 ? 1 : 0;
			var l2 = n > 4 ? n / 3 : n > 1 ? 1 : 0;
			var l3 = n > 2 ? 1 : 0;
			var l4 = n > 4 ? (n - 1) / 3 : n > 3 ? 1 : 0;

			Func <int, int, string> print = (k, m) => {
				var sb = new StringBuilder();
				for (var i = 1; i <= m; i++) {
					sb.AppendFormat("{0}.", (i <= k) ? "O" : "#" );
				}
				return sb.ToString();
			};

			Console.WriteLine("+------------------------+");
			Console.WriteLine("|{0}|D|)", print(l1, 11));
			Console.WriteLine("|{0}|.|", print(l2, 11));
			Console.WriteLine("|{0}......................|", print(l3, 1));
			Console.WriteLine("|{0}|.|)", print(l4, 11));
			Console.WriteLine("+------------------------+");
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int t = k;
            string s1 = "+------------------------+";
            string s2 = "|O.......................|";
            string s3 = "|#.......................|";
            string[,] mat = new string[3,11];
            if(k>=3)
            k--;
            mat[0, 0] = "|";
            mat[1, 0] = "|";
            mat[2, 0] = "|";
            for (int i = 0; i < 11; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (k > 0)
                    { mat[j, i] += "O"; k--; }
                    else
                        mat[j, i] += "#";
                }
            }
            Console.WriteLine(s1);
            for (int i = 0; i < 3; i++)
            {
                if (i == 2)
                Console.WriteLine((t>=3)?s2:s3);
                for (int j = 0; j < 11; j++)
                {
                    Console.Write(mat[i, j] + ".");
                }
                if (i == 0)
                    Console.Write("|D|)");
                else
                    if (i == 2)
                        Console.Write("|.|)");
                else
                        Console.Write("|.|");
                Console.WriteLine();
            }
            Console.WriteLine(s1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            /*  int k = Convert.ToInt32(Console.ReadLine());
              char[,] mas = new char[4, 11];

              for (int i = 0; i < 4; i++)
              {
                  for (int j = 0; j < 11; j++)
                      mas[i, j] = '#';

              }
              for (int i = 1; i < 11; i++)
                  mas[2, i] = '.';

              for (int i = 0; i < 4; i++)
                  for (int j = 0; j < 11;j++ )
                      if (k > 0 && mas[i, j] != '.')
                      { k--; mas[i, j] = '0'; }

              Console.WriteLine("+------------------------+");
              Console.Write('|');
              for (int i = 0; i < 11;i++ )
                  Console.Write(mas[0,i].ToString() +'.');
              Console.WriteLine("|D|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("|.|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("..|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("|.|)");

                  Console.WriteLine("+------------------------+");*/

            int k = Convert.ToInt32(Console.ReadLine());
            if (k < 5)
            {
                Console.WriteLine("+------------------------+");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|D|)");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|");
                if (k > 0) { Console.WriteLine("|O.......................|"); k--; }
                else Console.WriteLine("|#.......................|");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                Console.WriteLine("+------------------------+");
                return;
            }
            k = k - 4;
            Console.WriteLine("+------------------------+");
            for (int i = 0; i < 2; i++)
            {
                Console.Write("|O.");
                for (int j = 0; j < 10; j++)
                {
                    if (3 * j + i < k) Console.Write("O.");
                    else Console.Write("#.");
                }
                if (i == 0) Console.Write("|D|)");
                else Console.Write("|.|");
                Console.WriteLine();
            }
            Console.WriteLine("|O.......................|");

            Console.Write("|O.");
            for (int i = 0; i < 10; i++)
                if (3 * i + 2 < k) Console.Write("O.");
                else Console.Write("#.");
            Console.Write("|.|)");
            Console.WriteLine();
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
class Solver
{
    void Solve()
    {
        var p = Enumerable.Repeat('#', 34).ToArray();
        var n = sc.Integer();
        for (int i = 0; i < n; i++)
        {
            p[i] = 'O';
        }
        string format ="+------------------------+\n|{0}.{4}.{7}.{10}.{13}.{16}.{19}.{22}.{25}.{28}.{31}.|D|)\n|{1}.{5}.{8}.{11}.{14}.{17}.{20}.{23}.{26}.{29}.{32}.|.|\n|{2}.......................|\n|{3}.{6}.{9}.{12}.{15}.{18}.{21}.{24}.{27}.{30}.{33}.|.|)\n+------------------------+";
        Printer.PrintLine(format,p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15],p[16],p[17],p[18],p[19],p[20],p[21],p[22],p[23],p[24],p[25],p[26],p[27],p[28],p[29],p[30],p[31],p[32],p[33]);

    }

    static void Main()
    {
#if DEBUG
        var ostream = new System.IO.FileStream("debug.txt", System.IO.FileMode.Create, System.IO.FileAccess.Write);
        var iStream = new System.IO.FileStream("input.txt", System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.ReadWrite);
        Console.SetIn(new System.IO.StreamReader(iStream));
        System.Diagnostics.Debug.AutoFlush = true;
        System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(new System.IO.StreamWriter(ostream, System.Text.Encoding.UTF8)));
        try
        {
#endif
            var solver = new Solver();
            solver.Solve();
#if DEBUG
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
            Console.WriteLine(ex.StackTrace);
        }
        Console.ReadKey(true);
#endif
    }
    _Scanner sc = new _Scanner();

}

static public class Printer
{
    static readonly private System.IO.TextWriter writer;
    static readonly private System.Globalization.CultureInfo info;
    static string Separator { get; set; }
    static Printer()
    {
        writer = Console.Out;
        info = System.Globalization.CultureInfo.InvariantCulture;
        Separator = " ";
    }

    static public void Print(int num) { writer.Write(num.ToString(info)); }
    static public void Print(int num, string format) { writer.Write(num.ToString(format, info)); }
    static public void Print(long num) { writer.Write(num.ToString(info)); }
    static public void Print(long num, string format) { writer.Write(num.ToString(format, info)); }
    static public void Print(double num) { writer.Write(num.ToString(info)); }
    static public void Print(double num, string format) { writer.Write(num.ToString(format, info)); }
    static public void Print(string str) { writer.Write(str); }
    static public void Print(string format, params object[] arg) { writer.Write(format, arg); }
    static public void Print(IEnumerable<char> sources) { writer.Write(sources.AsString()); }
    static public void Print(params object[] arg)
    {
        var res = new System.Text.StringBuilder();
        foreach (var x in arg)
        {
            res.AppendFormat(info, "{0}", x);
            if (!string.IsNullOrEmpty(Separator))
                res.Append(Separator);
        }
        writer.Write(res.ToString(0, res.Length - Separator.Length));
    }
    static public void Print<T>(IEnumerable<T> sources)
    {
        var res = new System.Text.StringBuilder();
        foreach (var x in sources)
        {
            res.AppendFormat(info, "{0}", x);
            if (string.IsNullOrEmpty(Separator))
                res.Append(Separator);
        }
        writer.Write(res.ToString(0, res.Length - Separator.Length));
    }
    static public void PrintLine(int num) { writer.WriteLine(num.ToString(info)); }
    static public void PrintLine(int num, string format) { writer.WriteLine(num.ToString(format, info)); }
    static public void PrintLine(long num) { writer.WriteLine(num.ToString(info)); }
    static public void PrintLine(long num, string format) { writer.WriteLine(num.ToString(format, info)); }
    static public void PrintLine(double num) { writer.WriteLine(num.ToString(info)); }
    static public void PrintLine(double num, string format) { writer.WriteLine(num.ToString(format, info)); }
    static public void PrintLine(string str) { writer.WriteLine(str); }
    static public void PrintLine(string format, params object[] arg) { writer.WriteLine(format, arg); }
    static public void PrintLine(IEnumerable<char> sources) { writer.WriteLine(sources.AsString()); }
    static public void PrintLine(params object[] arg)
    {
        var res = new System.Text.StringBuilder();
        foreach (var x in arg)
        {
            res.AppendFormat(info, "{0}", x);
            if (!string.IsNullOrEmpty(Separator))
                res.Append(Separator);
        }
        writer.WriteLine(res.ToString(0, res.Length - Separator.Length));
    }
    static public void PrintLine<T>(IEnumerable<T> sources)
    {
        var res = new System.Text.StringBuilder();
        foreach (var x in sources)
        {
            res.AppendFormat(info, "{0}", x);
            if (!string.IsNullOrEmpty(Separator))
                res.Append(Separator);
        }
        writer.WriteLine(res.ToString(0, res.Length - Separator.Length));
    }
    static public void PrintLine(System.Linq.Expressions.Expression<Func<string, object>> ex)
    {
        var res = ex.Parameters[0];
        writer.WriteLine(res.Name);
    }
}
public class _Scanner
{
    readonly private System.Globalization.CultureInfo info;
    readonly System.IO.TextReader reader;
    string[] buffer = new string[0];
    int position;

    public char[] Separator { get; set; }
    public _Scanner(System.IO.TextReader reader = null, string separator = null, System.Globalization.CultureInfo info = null)
    {

        this.reader = reader ?? Console.In;
        if (string.IsNullOrEmpty(separator))
            separator = " ";
        this.Separator = separator.ToCharArray();
        this.info = info ?? System.Globalization.CultureInfo.InvariantCulture;
    }
    public string Scan()
    {
        if (this.position < this.buffer.Length)
            return this.buffer[this.position++];
        this.buffer = this.reader.ReadLine().Split(this.Separator, StringSplitOptions.RemoveEmptyEntries);
        this.position = 0;
        return this.buffer[this.position++];
    }

    public string[] ScanToEndLine()
    {
        if (this.position >= this.buffer.Length)
            return this.reader.ReadLine().Split(this.Separator, StringSplitOptions.RemoveEmptyEntries);
        var size = this.buffer.Length - this.position;
        var ar = new string[size];
        Array.Copy(this.buffer, position, ar, 0, size);
        return ar;

    }

    public string ScanLine()
    {
        if (this.position >= this.buffer.Length)
            return this.reader.ReadLine();
        else
        {
            var sb = new System.Text.StringBuilder();
            for (; this.position < buffer.Length; this.position++)
            {
                sb.Append(this.buffer[this.position]);
                sb.Append(' ');
            }
            return sb.ToString();
        }
    }
    public string[] ScanArray(int length)
    {
        var ar = new string[length];
        for (int i = 0; i < length; i++)
        {
            ar[i] = this.Scan();
        }
        return ar;
    }

    public int Integer()
    {
        return int.Parse(this.Scan(), info);
    }
    public long Long()
    {
        return long.Parse(this.Scan(), info);
    }
    public double Double()
    {
        return double.Parse(this.Scan(), info);
    }
    public double Double(string str)
    {
        return double.Parse(str, info);
    }

    public int[] IntArray(int length)
    {
        var a = new int[length];
        for (int i = 0; i < length; i++)
            a[i] = this.Integer();
        return a;
    }
    public long[] LongArray(int length)
    {
        var a = new long[length];
        for (int i = 0; i < length; i++)
            a[i] = this.Long();
        return a;
    }
    public double[] DoubleArray(int length)
    {
        var a = new double[length];
        for (int i = 0; i < length; i++)
            a[i] = this.Double();
        return a;
    }

}
static public partial class EnumerableEx
{
    static public string AsString(this IEnumerable<char> source)
    {
        return new string(source.ToArray());
    }
    static public IEnumerable<T> Enumerate<T>(this int count, Func<int, T> selector)
    {
        return Enumerable.Range(0, count).Select(x => selector(x));
    }
}
#region SegTree
[System.Diagnostics.DebuggerDisplay("Data={ToString()}")]
public class SegmentTree
{
    const long Max = 1L << 60;
    int n;
    long[] data;
    public SegmentTree(int size)
    {
        n = 1;
        while (n < size)
            n <<= 1;
        data = new long[n << 1];
        for (int i = 0; i < data.Length; i++)
            data[i] = Max;
    }

    ///Data[i]>
    public long this[int i]
    {
        get { return data[i + n]; }
    }
    ///Minimum[a,b)>
    public long this[int l, int r]
    {
        get { return Query(l, r, 1, 0, n); }
    }
    // turn kth index value into v
    public void Update(int k, long v)
    {
        k += n;
        while (k > 0)
        {
            data[k] = Math.Min(data[k], v);
            k >>= 1;
        }

    }
    private long Query(int a, int b, int k, int l, int r)
    {
        if (r <= a || b <= l)
            return Max;
        if (a <= l && r <= b)
            return data[k];
        else
        {
            var vl = Query(a, b, k << 1, l, (l + r) >> 1);
            var vr = Query(a, b, (k << 1) + 1, (l + r) >> 1, r);
            return Math.Min(vl, vr);
        }
    }
    public override string ToString()
    {
        return string.Join(",", Enumerable.Range(0, n).Select(i => this[i]).Where(v => v != Max));
    }
}
#endregion

using System;

namespace zadacha1
{
    class Program
    {
        private static void Main()
        {
            int num = Convert.ToInt32(Console.ReadLine());
            const string book = "+------------------------+";
            String
               [] f = {"|O.#.#.#.#.#.#.#.#.#.#.|D|)",
                 "|O.#.#.#.#.#.#.#.#.#.#.|.|"
                ,  "|O.......................|",
               "|O.#.#.#.#.#.#.#.#.#.#.|.|)"};

            if (num <= 4)
            {
                var j = 3;
                while (num!=4)
                {
                    var tmp= f[j].ToCharArray();
                    tmp[1] = '#';
                    f[j] = "";
                    foreach (var varia in tmp)
                    {
                        f[j] += varia;
                    }
                    j--;
                    num++;
                }
            }
            else
            {
                var n = (num - 4)/3;
                var k = (num - 4)%3;
                var i = 0;

                for (var j = 0; j < 3; j++)
                {
                    if (j == 2) j++;
                    var l = 3;
                    var tmp = f[j].ToCharArray();
                    int z = 0, count=n;
                    if (k > 0)
                    {
                        count++;
                        k--;
                    }
                    for (int c = 0; c < count; c++)
                    {
                        tmp[l] = 'O';
                        l += 2;
                    }
                    f[j] = "";
                    foreach (var varia in tmp)
                    {
                        f[j] += varia;
                    }
                }
            }
            Console.WriteLine(book);
            Console.WriteLine(f[0]);
            Console.WriteLine(f[1]);
            Console.WriteLine(f[2]);
            Console.WriteLine(f[3]);
            Console.WriteLine(book);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = Convert.ToInt16(Console.ReadLine());

            Console.WriteLine("+------------------------+");
            if (x < 1) Console.Write("|#.");
            else Console.Write("|O.");
            for (int m = 5; m <= 32; m = m + 3)
            {
                if (x >= m) Console.Write("O.");
                else Console.Write("#.");
            }

            Console.Write("|D|)\n");
            if (x < 2) Console.Write("|#.");
            else Console.Write("|O.");
            for (int m = 6; m <= 33; m = m + 3)
            {
                if (x >= m) Console.Write("O.");
                else Console.Write("#.");
            }

            Console.Write("|.|\n");
            if (x < 3) Console.WriteLine("|#.......................|");
            else Console.WriteLine("|O.......................|");

            if (x < 4) Console.Write("|#.");
            else Console.Write("|O.");
            for (int m = 7; m <= 34; m = m + 3)
            {
                if (x >= m) Console.Write("O.");
                else Console.Write("#.");
            }
            Console.Write("|.|)\n");
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

public static class solver
{

    public static void Main()
    {
        var count = Convert.ToInt32(Console.ReadLine());

        var fmt =
@"+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+";

        var table = fmt.Split('\n').Select(s => s.ToCharArray()).ToArray();

        for (int j = 0; j < table[0].Length - 3; ++j) {
            for (int i = 0; i < table.Length; i++) {
                if (table[i][j] == 'O' || table[i][j] == '#') {
                    if (count > 0) {
                        table[i][j] = 'O';
                        --count;
                    }
                    else
                        table[i][j] = '#';
                }
            }
        }

        Console.WriteLine(String.Join("\n", table.Select(cs => cs.Aggregate("", (s, c) => s + c))));
        //Console.ReadLine();
    }
}

using System;
using System.Linq;
static class demo
{
    static void Main()
    {
        string s0 = "+------------------------+";
        string ss = "|#.......................|";
        string[] s = Enumerable.Range(0, 3).Select(x => "|#.#.#.#.#.#.#.#.#.#.#.|").ToArray();
        int n = int.Parse(Console.ReadLine());
        for (int i = 0; i < n; i++)
        {
            if (i <= 1) AddO(ref s[i]);
            else if (i == 2) AddO(ref ss);
            else AddO(ref s[(i - 1) % 3]);
        }
        Console.WriteLine("{0}\n{1}D|)\n{2}.|\n{3}\n{4}.|)\n{0}", s0, s[0], s[1], ss, s[2]);
    }
    static void AddO(ref string source)
    {
        int n = source.IndexOf('#');
        source = source.Remove(n, 1);
        source = source.Insert(n, "O");
    }
}

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            String a = Console.ReadLine();
            string h = calc(Int32.Parse(a));
            Console.Write(h.ToString());
        }

        static string calc(int a)
        {
            string res="+------------------------+\r\n";
            res += "|01.05.08.11.14.17.20.23.26.29.32.|D|)\r\n";
            res += "|02.06.09.12.15.18.21.24.27.30.33.|.|\r\n";
            res += "|03.......................|\r\n";
            res += "|04.07.10.13.16.19.22.25.28.31.34.|.|)\r\n";
            res += "+------------------------+";

            for (int i = 1; i <= a; i++)
                res = res.Replace(sdd(i.ToString()), "O");
            for (int i = a+1; i <= 34; i++)
                res = res.Replace(sdd(i.ToString()), "#");

            return res;

        }

        static  string sdd(string i)
        {
            if (i.Length == 1)
                return "0" + i;
            return i;
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeForces
{
    class Program
    {

        static void Main(string[] args)
        {

            int k = Convert.ToInt32(Console.ReadLine());
            int counter = 0;

            string[,] Arr = new string[4, 11] { {"#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"},
                                                {"#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"},
                                                {"#", ".", ".", ".", ".", ".", ".", ".", ".", ".", "."},
                                                {"#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"},
                                                                                };

            bool floopbreak = false;

            for (int i = 0; (!floopbreak) && i < 11; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (k == 0)
                    {
                        floopbreak = true;
                        break;
                    }

                    if (j == 2 && i > 0)
                    {
                        continue;
                    }

                    Arr[j, i] = "O";

                    counter++;
                    if (counter == k)
                    {

                        floopbreak = true;
                        break;
                    }
                }

            }

                Console.WriteLine("+------------------------+");
                Console.Write("|");

                for (int i = 0; i < 11; i++)
                {
                    Console.Write(Arr[0,i]+".");
                }

                Console.WriteLine("|D|)");
                Console.Write("|");
                for (int i = 0; i < 11; i++)
                {
                    Console.Write(Arr[1, i] + ".");
                }

                Console.WriteLine("|.|");

                Console.Write("|");
                Console.Write(Arr[2, 0]);
                Console.WriteLine(".......................|");

                Console.Write("|");
                for (int i = 0; i < 11; i++)
                {
                    Console.Write(Arr[3, i] + ".");
                }
                Console.WriteLine("|.|)");

                Console.WriteLine("+------------------------+");

        }
    }
}

using System;
using System.Globalization;
using System.IO;
using System.Text;

namespace Bayan_Bus
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

        private static string s =
            @"+------------------------+
|{0}.{4}.{7}.{10}.{13}.{16}.{19}.{22}.{25}.{28}.{31}.|D|)
|{1}.{5}.{8}.{11}.{14}.{17}.{20}.{23}.{26}.{29}.{32}.|.|
|{2}.......................|
|{3}.{6}.{9}.{12}.{15}.{18}.{21}.{24}.{27}.{30}.{33}.|.|)
+------------------------+";

        private static void Main(string[] args)
        {
            int n = Next();

            for (int i = 0; i < n; i++)
            {
                s = s.Replace("{" + i + "}", "O");
            }

            for (int i = n; i < 35; i++)
            {
                s = s.Replace("{" + i + "}", "#");
            }

            writer.Write(s);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
           // StreamReader sr = new StreamReader("11.in");
            //StreamWriter sw = new StreamWriter("11.out");

            int n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("+------------------------+");

            for (int j = 0; j < 4; j++)
            {
                Console.Write("|");
                for (int i = 0; i < 11 || (i < 1 && j == 1); i++)
                    Console.Write(seat(n, j, i) + ".");
                Console.WriteLine( (j == 2 ? "." : "|") + (j == 0 ? "D" : ".") + "|" + (j == 3 || j==0 ? ")" : ""));
            }

            Console.WriteLine("+------------------------+");
            Console.ReadLine();
        }

        static string seat(int k,int i,int j)
        {
            if (i == 2  && j>0)
                return ".";
            if (k > 4 && j == 0)
                return "O";
            if (k <= 4 && j==0)
                return k>i? "O":"#";

            k-=4; j--; i= i == 3 ? 2 : i;
            return k > j * 3 + i ? "O" : "#";
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bayan
{
    class Program
    {
        static List<string> Do(int PassengersCount)
        {
            List<string> Lines = new List<string>();

            var RowCount = 6;
            var ColumnCount = 27;
            var Bus = new char[RowCount, ColumnCount];

            for (int row = 0; row < RowCount; row++)
            {
                string line = "";

                for (int column = 0; column < ColumnCount; column++)
                {
                    if (row == 0 || row == RowCount - 1)
                    {
                        if (column == 0 || column == (ColumnCount - 2))
                            Bus[row, column] = '+';
                        else if (column == (ColumnCount - 1))
                            Bus[row, column] = ' ';
                        else
                            Bus[row, column] = '-';
                    }
                    else
                    {
                        // ستون های ردیف های 1 تا 4
                        if (column == 0)
                            Bus[row, column] = '|';
                        else
                        {
                            if (column < 23)
                            {
                                if (column == 1)
                                {
                                    Bus[row, column] = '#';
                                }
                                else
                                {
                                    if (row == 3)
                                        Bus[row, column] = '.';
                                    else
                                    {
                                        var isOdd = column % 2 == 1;
                                        if (isOdd)
                                        {
                                            Bus[row, column] = '#';
                                        }
                                        else
                                        {
                                            Bus[row, column] = '.';
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (column == 23)
                                {
                                    if (row != 3)
                                        Bus[row, column] = '|';
                                    else
                                        Bus[row, column] = '.';
                                }
                                else if (column == 24)
                                {
                                    if (row == 1)
                                        Bus[row, column] = 'D';
                                    else
                                        Bus[row, column] = '.';
                                }
                                else if (column == 25)
                                {
                                    Bus[row, column] = '|';
                                }
                                else if (column == 26)
                                {
                                    if (row == 1 || row == 4)
                                        Bus[row, column] = ')';
                                    else
                                        Bus[row, column] = ' ';
                                }
                            }
                        }

                    }

                    var s = Bus[row, column].ToString();
                    line = line + s;
                }

                Lines.Add(line);
            }

            //PassengersCount

            var c = 0;

            string[] BusArray = Lines.ToArray();

            while (PassengersCount != 0)
            {
                var ss = BusArray[c];

                if (c >= 1 && c <= 4)
                {
                    if (c == 3)
                    {
                        var cc = ss.ToCharArray();
                        for (int i = 0; i < cc.Length; i++)
                        {
                            if (i == 1)
                            {
                                if (cc[i] == '#')
                                {
                                    cc[i] = 'O';
                                    PassengersCount--;
                                    ss = string.Join("", cc);
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        var cc = ss.ToCharArray();

                        for (int r = 0; r < cc.Length; r++)
                        {
                            if (cc[r] == '#')
                            {
                                cc[r] = 'O';
                                PassengersCount--;
                                break;
                            }
                        }

                        ss = string.Join("", cc);
                    }

                }

                BusArray[c] = ss;

                c++;

                if (c > 5)
                    c = 0;
            };

            return BusArray.Select(u => u.Trim()).ToList();
        }

        static void Main(string[] args)
        {
            try
            {
                var OutputLines = Do(int.Parse(Console.ReadLine()));
                Console.Write(string.Join("\n", OutputLines));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.Write(Environment.NewLine);
                Console.Write("any key to exit");
                Console.ReadKey();
            }
        }
    }

    #region Extensions

    public static class Extensions
    {
        public static void ForEach<T>(this IEnumerable<T> Collection, Action<T, int> Action)
        {
            var ListCollection = Collection.ToList();

            var Length = ListCollection.Count;
            for (int i = 0; i < Length; i++)
            {
                Action(ListCollection[i], i);
            }
        }
    }

    #endregion

    #region IO

    public class IO
    {
        #region Constructor

        public IO(string InputPath, string OutputPath)
        {
            this.InputPath = InputPath;
            this.OutputPath = OutputPath;
        }

        #endregion

        #region Properties

        public string InputPath { get; set; }
        public string OutputPath { get; set; }

        #endregion

        #region Read Public Methods

        public string Read()
        {
            string Text = string.Empty;
            using (StreamReader Reader = new StreamReader(this.InputPath))
                Text = Reader.ReadToEnd();

            return Text;
        }

        public List<string> ReadLines()
        {
            var Text = Read();
            var Lines = Text
                .Split('\n')
                .Where(u => !string.IsNullOrEmpty(u))
                .ToList();
            return Lines;
        }

        #endregion

        #region Write Public Methods

        public void Write(string Text)
        {
            using (StreamWriter Writer = new StreamWriter(this.OutputPath))
                Writer.Write(Text);
        }

        public void WriteLines(List<string> Lines)
        {
            var Text = String.Join(Environment.NewLine, Lines);
            Write(Text);
        }

        #endregion
    }

    #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace CodForceX
{
    class Program
    {
        static void Main(string[] args)
        {
            var bus = new string[]
                      {
                          "+------------------------+",
                          "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
                          "|#.#.#.#.#.#.#.#.#.#.#.|.|",
                          "|#.......................|",
                          "|#.#.#.#.#.#.#.#.#.#.#.|.|)",
                          "+------------------------+"
                      };
            var n = Int32.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                var l1 = bus[1].IndexOf("#");
                var l2 = bus[2].IndexOf("#");
                var l3 = bus[3].IndexOf("#");
                var l4 = bus[4].IndexOf("#");

                var d = new Dictionary<int, int>();
                if (l1 >= 0) d.Add(1, l1);
                if (l2 >= 0) d.Add(2, l2);
                if (l3 >= 0) d.Add(3, l3);
                if (l4 >= 0) d.Add(4, l4);

                var m = d.First(x => x.Value == d.Values.Min());
                bus[m.Key] = bus[m.Key].Remove(m.Value,1);
                bus[m.Key] = bus[m.Key].Insert(m.Value, "O");

            }

            for (int i = 0; i < bus.Count(); i++)
            {
                Console.WriteLine(bus[i]);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.IO;
using System.Numerics;
using System.Globalization;
using System.Threading;

namespace probleme {
    class Program {
        static int k = 0;
        static void solve(int row) {
            if (row == 0 || row == 5) {
                Console.WriteLine("+------------------------+");
                return;
            }
            if (row == 3) {
                Console.Write("|");
                if (k >= 3) {
                    Console.Write("O");
                } else {
                    Console.Write("#");
                }
                Console.WriteLine(".......................|");
                return;
            }
            if (row == 2) {
                Console.Write("|");
                if (k >= 2) {
                    Console.Write("O.");
                } else {
                    Console.Write("#.");
                }
                for (int i = 6; i <= 33; i += 3) {
                    if (k >= i) {
                        Console.Write("O.");
                    } else {
                        Console.Write("#.");
                    }
                }
                Console.WriteLine("|.|");
                return;
            }
            if (row == 1) {
                Console.Write("|");
                if (k >= 1) {
                    Console.Write("O.");
                } else {
                    Console.Write("#.");
                }
                for (int i = 5; i <= 32; i += 3) {
                    if (k >= i) {
                        Console.Write("O.");
                    } else {
                        Console.Write("#.");
                    }
                }
                Console.WriteLine("|D|)");
                return;
            }
            if (row == 4) {
                Console.Write("|");
                if (k >= 4) {
                    Console.Write("O.");
                } else {
                    Console.Write("#.");
                }
                for (int i = 7; i <= 34; i += 3) {
                    if (k >= i) {
                        Console.Write("O.");
                    } else {
                        Console.Write("#.");
                    }
                }
                Console.WriteLine("|.|)");
                return;
            }
        }

        static void Main(string[] args) {

            //Console.SetIn(new StreamReader("file.in"));
            /*
            FileStream filestream = new FileStream("out.txt", FileMode.Create);
            var streamwriter = new StreamWriter(filestream);
            streamwriter.AutoFlush = true;
            Console.SetOut(streamwriter);
            */

            k = int.Parse(Console.ReadLine());
            for (int i = 0; i < 6; i++) {
                solve(i);
            }

            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bayan
{
    class Program
    {
        static void Main(string[] args)
        {

            String[] lastRow = new String[4];
            int lastRowFillCounter = 0;
            String[,] remainingRows = new String[10, 3];
            String input = Console.ReadLine();
            int inputNumber = Convert.ToInt32(input);
            for (int i = 0; i < lastRow.Length; i++)
            {
                lastRow[i] = "#";
            }
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    remainingRows[i, j] = "#";
                }
            }
            int lastRowIndex = 0;
            int remainRowFirstIndex = 0;
            int remainRowSecondIndex = 0;
            for (int k = 0; k < inputNumber; k++)
            {
                if (lastRowFillCounter < 4)
                {
                    lastRow[lastRowFillCounter] = "O";
                    lastRowFillCounter++;
                }
                else
                {
                    if (remainRowSecondIndex > 2)
                    {
                        remainRowSecondIndex = 0;
                        remainRowFirstIndex++;
                    }

                    remainingRows[remainRowFirstIndex, remainRowSecondIndex] = "O";
                    remainRowSecondIndex++;
                }
            }
            String firstAnswer = "+------------------------+";
            string firstRowAnswer = "|" + lastRow[0];
            for (int i = 0; i < 10; i++)
            {
                firstRowAnswer = firstRowAnswer + "." + remainingRows[i, 0];
            }
            firstRowAnswer = firstRowAnswer + ".|D|)";

            String secondRowAnswer = "|" + lastRow[1];
            for (int i = 0; i < 10; i++)
            {
                secondRowAnswer = secondRowAnswer + "." + remainingRows[i, 1];
            }
            secondRowAnswer = secondRowAnswer + ".|.|";

            String thirdRowAnswer = "|" + lastRow[2] + ".......................|";

            String forthRowAnswer = "|" + lastRow[3];
            for (int i = 0; i < 10; i++)
            {
                forthRowAnswer = forthRowAnswer + "." + remainingRows[i, 2];
            }
            forthRowAnswer = forthRowAnswer + ".|.|)";

            String endLine = "+------------------------+";
            Console.WriteLine(firstAnswer);
            Console.WriteLine(firstRowAnswer);
            Console.WriteLine(secondRowAnswer);
            Console.WriteLine(thirdRowAnswer);
            Console.WriteLine(forthRowAnswer);
            Console.WriteLine(endLine);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            string[] output = new string[6];
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[1, 12] = "|D";
            bus[1, 13] = "|";
            bus[2, 12] = "|.";
            bus[2, 13] = "|";
            bus[4, 12] = "|.";
            bus[4, 13] = "|";
            bus[3, 13] = "|";
            for (int i = 1; i < 5; i++)
            {
                bus[i, 0] = "|";
            }

            for (int i = 2; i <= 11; i++)
            {
                bus[3, i] = "..";
            }
            bus[3, 12] += "..";
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != "..") && (n != 0) )
                    {
                        bus[j, i] = "O.";
                        n--;
                    }
                    else if ( (bus[j,i] != ".."))
                    {
                        bus[j, i] = "#.";
                    }

                }

            }

            Console.Write('+');
            for (int l = 1; l < 25; l++)
            {
                Console.Write('-');
            }
            Console.Write('+');
            for (int i = 1; i < 5; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    output[i] += bus[i, j];

                }

                if ((i == 1) || (i == 4))
                {
                    Console.Write(output[i] + ')');
                }
                else
                {
                    Console.Write(output[i]);
                }
            }
            Console.WriteLine();
            Console.Write('+');
            for (int l = 1; l < 25; l++)
            {
                Console.Write('-');
            }
            Console.Write('+');

            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;

namespace prA {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter("output");
        private static readonly StreamReader reader = new StreamReader("input");
#endif
        static void Main(string[] args) {
            int n = Next();
            char[][] map = {
                "+------------------------+".ToCharArray(),
                "|#.#.#.#.#.#.#.#.#.#.#.|D|)".ToCharArray(),
                "|#.#.#.#.#.#.#.#.#.#.#.|.|".ToCharArray(),
                "|#.......................|".ToCharArray(),
                "|#.#.#.#.#.#.#.#.#.#.#.|.|)".ToCharArray(),
                "+------------------------+".ToCharArray()
            };
            for(int x = 0; n > 0 && x < 23; x++) {
                for(int y = 0; n > 0 && y < 6; y++) {
                    if(map[y][x] != '#')
                        continue;
                    map[y][x] = 'O';
                    n--;
                }
            }
            for(int i = 0; i < 6; i++) {
                writer.WriteLine(new string(map[i]));
            }
            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;

// (づ°ω°)づﾐ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    private char[][] bus = new[]
    {
        "+------------------------+".ToCharArray(),
        "|#.#.#.#.#.#.#.#.#.#.#.|D|)".ToCharArray(),
        "|#.#.#.#.#.#.#.#.#.#.#.|.|".ToCharArray(),
        "|#.......................|".ToCharArray(),
        "|#.#.#.#.#.#.#.#.#.#.#.|.|)".ToCharArray(),
        "+------------------------+".ToCharArray()
    };

    public object Solve()
    {
        int n = ReadInt();
        for (int i = 0; i < Math.Min(n, 4); i++)
            bus[i + 1][1] = 'O';

        for (int i = 0; i < n - 4; i++)
            bus[i % 3 == 2 ? 4 : (i % 3 + 1)][i / 3 * 2 + 3] = 'O';

        foreach (var line in bus)
            writer.WriteLine(new string(line));

        return null;
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
#endif
        try
        {
            object result = new Solver().Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            Console.WriteLine(ex);
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }

    #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }
    public int CompareTo(PairVariable pv)
    {
        if (this.a > pv.a)
        {
            return 1;
        }
        else if (this.a < pv.a)
        {
            return -1;
        }
        else
        {
            if (this.b >= pv.b)
            {
                return 1;
            }
            else
            {
                return -1;
            }
        }
    }

}
namespace ConsoleApplication254
{
    class Program
    {
        static Dictionary<int, List<int>> d = new Dictionary<int, List<int>>();
        static int[] mark;
        static Dictionary<long, long> cnt;
        static int[] color;
        static int size = 0;
        static void dfs(int v)
        {
            size++;
            mark[v] = 1;
            bool w = false;
            if (cnt.ContainsKey(color[v]))
            {
                cnt[color[v]]++;
            }
            else
            {
                cnt.Add(color[v], 1);
            }
            for (int i = 0; i < d[v].Count; i++)
            {
                if (mark[d[v][i]] == 0)
                {

                    dfs(d[v][i]);
                }

            }

        }
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            int k1 = 0;
            int k2 = 0;
            int k3 = 0;
            if (n > 4)
            {
                string a1 = "+------------------------+";
                string a2 = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
                string a3 = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
                string a4 = "|O.......................|";
                string a5 = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
                string a6 = "+------------------------+";
                if ((n - 1) % 3 == 0)
                {
                    k1 = (n - 1) / 3;
                    k2 = (n - 1) / 3;
                    k3 = (n - 1) / 3;
                }
                else if ((n - 1) % 3 == 1)
                {
                    k1 = (n - 1) / 3 + 1;
                    k2 = (n - 1) / 3;
                    k3 = (n - 1) / 3;
                }
                else
                {
                    k1 = (n - 1) / 3 + 1;
                    k2 = (n - 1) / 3 + 1;
                    k3 = (n - 1) - (k1 + k2);
                }
                //Console.WriteLine(k1+" "+k2+" "+k3);
                int k = 1;
                string c1 = a1;
                string c2 = "";
                string c3 = "";
                string c4 = a4;
                string c5 = "";
                string c6 = a6;
                for (int i = 0; i < a2.Length; i++)
                {
                    if (k <= k1)
                    {
                        if (a2[i] == '#')
                        {
                            c2 += 'O';
                            k++;
                        }
                        else
                        {
                            c2 += a2[i];
                        }
                    }
                    else
                    {
                        c2 += a2[i];
                    }
                }
                k = 1;
                for (int i = 0; i < a3.Length; i++)
                {
                    if (k <= k2)
                    {
                        if (a3[i] == '#')
                        {
                            c3 += 'O';
                            k++;
                        }
                        else
                        {
                            c3 += a3[i];
                        }
                    }
                    else
                    {
                        c3 += a3[i];
                    }
                }
                k = 1;
                for (int i = 0; i < a5.Length; i++)
                {
                    if (k <= k3)
                    {
                        if (a5[i] == '#')
                        {
                            c5 += 'O';
                            k++;
                        }
                        else
                        {
                            c5 += a5[i];
                        }
                    }
                    else
                    {
                        c5 += a5[i];
                    }
                }
                Console.WriteLine(c1);
                Console.WriteLine(c2);
                Console.WriteLine(c3);
                Console.WriteLine(c4);
                Console.WriteLine(c5);
                Console.WriteLine(c6);
            }
            else
            {

                if (n == 1)
                {
                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|#.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else if (n == 2)
                {

                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|#.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else if (n == 3)
                {
                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|O.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else if (n == 4)
                {
                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|O.......................|");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else
                {

                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|#.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
            }
        }
    }
}

/*
 * Created by SharpDevelop.
 * Handle: Arcos
 */
using System;
using System.Collections;
using System.ComponentModel;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;

namespace TestingStuff
{
	class Program
	{
		public static void Main(string[] args)
		{
			var v = int.Parse(Console.ReadLine());
			var a = "";
			var b = "";
			var c = "";
			var d = "";
			if (v >= 3){
				c = "O.";
				v--;
			} else {
				c = "#.";
			}
			int j = v / 3;
			doStuff(ref a,ref j,v);
			doStuff(ref b,ref j,v);
			doStuff(ref d,ref j,v);
			j = v - j * 3;
			doStuff2(ref a,ref j, v);
			doStuff2(ref b,ref j, v);
			doStuff2(ref d,ref j, v);
			Console.WriteLine("+------------------------+");
			Console.WriteLine("|"+a+"|D|)");
			Console.WriteLine("|"+b+"|.|");
			Console.WriteLine("|"+c+"......................|");
			Console.WriteLine("|"+d+"|.|)");
			Console.WriteLine("+------------------------+");
//			Console.ReadLine();
			return;
		}

		public static void doStuff(ref string a, ref int j, int v){
			for (int i = 0; i < j; i++){
				a += "O.";
			}
		}

		public static void doStuff2(ref string a, ref int j, int v){
			if (j > 0){
				a += "O.";
				j--;
			}
			while (a.Length < 22){
				a += "#.";
			}
		}

		public static void print(string a){
			Console.WriteLine(a);
		}
	}
}

// Remember these:
// String.Format("{0:0}",f).ToString();
// Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
// var splstr = Console.ReadLine().Split(' ').ToList();
// var str = Console.ReadLine();
// var l = new List<int>();

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            string[,] array = new string[4, 11];
            int count = 0;
            bool one = true;
            for (int i = 0; i < 11; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (k > 0)
                    {
                        if (count != 2)
                        {
                            array[j, i] = "O";
                            k--;
                        }
                        if ((count == 2) && (one == false))
                        {
                            array[j, i] = ".";
                        }
                        if ((count == 2) && (one == true))
                        {
                            array[j, i] = "O";
                            k--;
                            one = false;
                        }
                        count++;
                    }
                    else
                    {
                        if (count != 2)
                        {
                            array[j, i] = "#";
                            k--;
                        }
                        if ((count == 2) && (one == false))
                        {
                            array[j, i] = ".";
                        }
                        if ((count == 2) && (one == true))
                        {
                            array[j, i] = "#";
                            k--;
                            one = false;
                        }
                        count++;
                    }

                }
                count = 0;
            }

            Console.WriteLine("+------------------------+");

            Console.Write("|");
            for (int j = 0; j < 11; j++)
                {
                    Console.Write(array[0, j] + ".");
                }
            Console.Write("|");
            Console.Write("D");
            Console.Write("|");
            Console.WriteLine(")");

            Console.Write("|");
            for (int j = 0; j < 11; j++)
            {
                Console.Write(array[1, j] + ".");
            }
            Console.Write("|");
            Console.Write(".");
            Console.WriteLine("|");

            Console.Write("|");
            for (int j = 0; j < 11; j++)
            {
                Console.Write(array[2, j] + ".");
            }
            Console.Write(".");
            Console.Write(".");
            Console.WriteLine("|");

            Console.Write("|");
            for (int j = 0; j < 11; j++)
            {
                Console.Write(array[3, j] + ".");
            }
            Console.Write("|");
            Console.Write(".");
            Console.Write("|");
            Console.WriteLine(")");

            Console.WriteLine("+------------------------+");

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CF475A {
    class Program {
        static void Main(string[] args) {
            int passengers = int.Parse(Console.ReadLine());

            Console.WriteLine("+------------------------+");
            for(int row = 0; row < 4; row++) {
                string r = "|";
                int seats = (passengers - 4) / 3;
                if(row == 0) {
                    if((passengers - 4) % 3 > 0) {
                        seats += 1;
                    }
                } else if(row == 1) {
                    if((passengers - 4) % 3 > 1) {
                        seats += 1;
                    }
                }
                if(row == 2) {
                    if(passengers >= 3) {
                        Console.WriteLine("|O.......................|");
                    } else {
                        Console.WriteLine("|#.......................|");
                    }
                    continue;
                }

                for(int i = 0; i <= seats; i++) {
                    if(row == 3 && passengers < 4) {
                        seats--;
                        continue;
                    }
                    r += "O.";
                }
                if(passengers - (row + 1) == 0 && row == 0) {
                    r += "O.";
                    seats++;
                }
                for(int i = seats; i < 10; i++) {
                    r += "#.";

                }
                if(row == 0) {
                    r += "|D|)";
                } else if(row == 1) {
                    r += "|.|";
                } else if(row == 2) {
                    r += "..|";
                } else if (row == 3) {
                    r += "|.|)";
                }
                Console.WriteLine(r);
            }
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Globalization;
class Program
{
    static TextReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
    static TextWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
    static void Main()
    {
        var n = int.Parse(reader.ReadLine());
        var b = @"+------------------------+
|#.#.#.#.#.#.#.#.#.#.#.|D|)
|#.#.#.#.#.#.#.#.#.#.#.|.|
|#.......................|
|#.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

".ToCharArray();
 		var s = new[] { 29, 58, 86, 114, 31, 60, 116, 33,  62, 118,35,  64,  120,37,  66, 122,39, 68,   124, 41,  70,126,43,  72,  128,45,  74, 130, 47, 76, 132, 49, 78, 134 };
		for (int i = 0;i<n ; i++)
        {
			b [s [i]] = 'O';
        }
        writer.WriteLine(b);
        reader.Close();
        writer.Close();
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace codeforces
{
	class Program
	{
		public const int Osn = 1000000007;

		public class Pair
		{
			public int First;

			public int Second;
		}

		public class PairComparer : IComparer<Pair>
		{
			public int Compare(Pair x, Pair y)
			{
				if (x.First > y.First || (x.First == y.First && x.Second < y.Second))
					return -1;
				return 1;
			}
		}

		public static long GetGcd(long a, long b)
		{
			while (true)
			{
				if (b == 0)
					return a;
				var a1 = a;
				a = b;
				b = a1 % b;
			}
		}

		public static void WriteYesNo(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string ReadString()
		{
			return Console.ReadLine();
		}

		public static List<int> ReadListOfInts()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static List<long> ReadListOfLongs()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(long.Parse).ToList();
		}

		public static int ReadInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static long ReadLong()
		{
			var s = Console.ReadLine();
			return long.Parse(s);
		}

		public class Vertex
		{
			public int Was;

			public List<int> Edges;
		}

		public static List<Vertex> Graph = new List<Vertex>();

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		private static void Main()
		{
			var bus = new List<StringBuilder>
			{
				new StringBuilder("+------------------------+"),
				new StringBuilder("|#.#.#.#.#.#.#.#.#.#.#.|D|)"),
				new StringBuilder("|#.#.#.#.#.#.#.#.#.#.#.|.|"),
				new StringBuilder("|#.......................|"),
				new StringBuilder("|#.#.#.#.#.#.#.#.#.#.#.|.|)"),
				new StringBuilder("+------------------------+")
			};
			var k = ReadInt();
			var curx = 1;
			var cury = 1;
			while (k > 0)
			{
				if (bus[curx][cury] == '#')
				{
					k--;
					bus[curx][cury] = 'O';
				}
				else
				{
					if (curx != 4)
						curx++;
					else
					{
						curx = 1;
						cury++;
					}
				}
			}
			foreach (var q in bus)
				Console.WriteLine(q.ToString());
			Console.ReadLine();
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace codeforces
{
	class Program
	{
		public const int Osn = 1000000007;

		public class Pair
		{
			public int First;

			public int Second;
		}

		public class PairComparer : IComparer<Pair>
		{
			public int Compare(Pair x, Pair y)
			{
				if (x.First > y.First || (x.First == y.First && x.Second < y.Second))
					return -1;
				return 1;
			}
		}

		public static long GetGcd(long a, long b)
		{
			while (true)
			{
				if (b == 0)
					return a;
				var a1 = a;
				a = b;
				b = a1 % b;
			}
		}

		public static void WriteYesNo(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string ReadString()
		{
			return Console.ReadLine();
		}

		public static List<int> ReadListOfInts()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static List<long> ReadListOfLongs()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(long.Parse).ToList();
		}

		public static int ReadInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static long ReadLong()
		{
			var s = Console.ReadLine();
			return long.Parse(s);
		}

		public class Vertex
		{
			public int Was;

			public List<int> Edges;
		}

		public static List<Vertex> Graph = new List<Vertex>();

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		private static void Main()
		{
			var bus = new List<StringBuilder>
			{
				new StringBuilder("+------------------------+"),
				new StringBuilder("|#.#.#.#.#.#.#.#.#.#.#.|D|)"),
				new StringBuilder("|#.#.#.#.#.#.#.#.#.#.#.|.|"),
				new StringBuilder("|#.......................|"),
				new StringBuilder("|#.#.#.#.#.#.#.#.#.#.#.|.|)"),
				new StringBuilder("+------------------------+")
			};
			var k = ReadInt();
			var curx = 1;
			var cury = 1;
			while (k > 0)
			{
				if (bus[curx][cury] == '#')
				{
					k--;
					bus[curx][cury] = 'O';
				}
				else
				{
					if (curx != 4)
						curx++;
					else
					{
						curx = 1;
						cury++;
					}
				}
			}
			foreach (var t in bus)
				Console.WriteLine(t.ToString());
			Console.ReadLine();
		}
	}
}

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace _475A
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Int32.Parse(Console.ReadLine());

            Processing(k);

        }

        private static void Processing(int k)
        {
            int max = 34;
            Line first = new Line(11);
            Line second = new Line(11);
            Line third = new Line(1);
            Line fourth = new Line(11);
            Line[] lines = { first, second, third, fourth };

            int current = 0;

            if (k <= 6)
            {
                while (k > 0)
                {
                    if (lines[current].canAdd)
                    {
                        lines[current].AddPassenger();
                        k--;
                    }
                    current++;
                    if (current >= lines.Length)
                    {
                        current = 0;
                    }
                }
            }
            else
            {
                while (k >= 0)
                {
                    if (lines[current].canAdd)
                    {
                        lines[current].AddPassenger();
                        k--;
                    }
                    current++;
                    if (current >= lines.Length)
                    {
                        current = 0;
                    }
                }
            }

            StringBuilder result = new StringBuilder();
            result.Append("+------------------------+\n");

            //first
            result.Append("|");
            foreach (var place in lines[0].emptyPlaces)
            {
                if (!place)
                {
                    result.Append("O.");
                }
                else
                {
                    result.Append("#.");
                }
            }
            result.Append("|D|)\n");

            //second
            result.Append("|");
            foreach (var place in lines[1].emptyPlaces)
            {
                if (!place)
                {
                    result.Append("O.");
                }
                else
                {
                    result.Append("#.");
                }
            }
            result.Append("|.|\n");

            //third
            result.Append("|");
            foreach (var place in lines[2].emptyPlaces)
            {
                if (!place)
                {
                    result.Append("O.");
                }
                else
                {
                    result.Append("#.");
                }
            }
            result.Append("......................|\n");

            //fourth
            result.Append("|");
            foreach (var place in lines[3].emptyPlaces)
            {
                if (!place)
                {
                    result.Append("O.");
                }
                else
                {
                    result.Append("#.");
                }
            }
            result.Append("|.|)\n");

            result.Append("+------------------------+");

            Console.WriteLine(result);

        }

        class Line
        {
            private int places;
            public bool[] emptyPlaces { get; set; }
            private int cursor;
            public bool canAdd { get; set; }

            public Line(int number)
            {
                cursor = 0;
                canAdd = true;
                places = number;
                emptyPlaces = new bool[places];
                for (int i = 0; i < emptyPlaces.Length; i++)
                    emptyPlaces[i] = true;
            }

            public void AddPassenger()
            {
                canAdd = cursor < emptyPlaces.Length;
                if (canAdd)
                {
                    emptyPlaces[cursor] = false;
                    cursor++;
                }
            }

            public void Print()
            {
                for (int i = 0; i < emptyPlaces.Length; i++)
                {
                    if (emptyPlaces[i])
                    {
                        Console.Write("T ");
                    }
                    else
                    {
                        Console.Write("F ");
                    }
                }
                Console.Write("\n");
            }
        }
    }
}

using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;

namespace work01
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			var n = Int32.Parse (Console.ReadLine ());

			var l1 = n > 4 ? (n + 1) / 3 : n > 0 ? 1 : 0;
			var l2 = n > 4 ? n / 3 : n > 1 ? 1 : 0;
			var l3 = n > 3 ? 1 : 0;
			var l4 = n > 4 ? (n - 1) / 3 : n > 3 ? 1 : 0;

			Func <int, int, string> print = (k, m) => {
				var sb = new StringBuilder();
				for (var i = 1; i <= m; i++) {
					sb.AppendFormat("{0}.", (i <= k) ? "0" : "#" );
				}
				return sb.ToString();
			};

			Console.WriteLine("+------------------------+");
			Console.WriteLine("|{0}|D|)", print(l1, 11));
			Console.WriteLine("|{0}|.|", print(l2, 11));
			Console.WriteLine("|{0}......................|", print(l3, 1));
			Console.WriteLine("|{0}|.|)", print(l4, 11));
			Console.Write("+------------------------+");
		}
	}
}

using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;

namespace work01
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			var n = Int32.Parse (Console.ReadLine ());

			var l1 = n > 4 ? (n + 1) / 3 : n > 0 ? 1 : 0;
			var l2 = n > 4 ? n / 3 : n > 1 ? 1 : 0;
			var l3 = n > 3 ? 1 : 0;
			var l4 = n > 4 ? (n - 1) / 3 : n > 3 ? 1 : 0;

			Func <int, int, string> print = (k, m) => {
				var sb = new StringBuilder();
				for (var i = 1; i <= m; i++) {
					sb.AppendFormat("{0}.", (i <= k) ? "0" : "#" );
				}
				return sb.ToString();
			};

			Console.WriteLine("+------------------------+");
			Console.WriteLine("|{0}|D|)", print(l1, 11));
			Console.WriteLine("|{0}|.|", print(l2, 11));
			Console.WriteLine("|{0}......................|", print(l3, 1));
			Console.WriteLine("|{0}|.|)", print(l4, 11));
			Console.WriteLine("+------------------------+");
		}
	}
}

using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;

namespace work01
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			var n = Int32.Parse (Console.ReadLine ());

			var l1 = n > 4 ? (n + 1) / 3 : n > 0 ? 1 : 0;
			var l2 = n > 4 ? n / 3 : n > 1 ? 1 : 0;
			var l3 = n > 2 ? 1 : 0;
			var l4 = n > 4 ? (n - 1) / 3 : n > 3 ? 1 : 0;

			Func <int, int, string> print = (k, m) => {
				var sb = new StringBuilder();
				for (var i = 1; i <= m; i++) {
					sb.AppendFormat("{0}.", (i <= k) ? "0" : "#" );
				}
				return sb.ToString();
			};

			Console.WriteLine("+------------------------+");
			Console.WriteLine("|{0}|D|)", print(l1, 11));
			Console.WriteLine("|{0}|.|", print(l2, 11));
			Console.WriteLine("|{0}......................|", print(l3, 1));
			Console.WriteLine("|{0}|.|)", print(l4, 11));
			Console.Write("+------------------------+");
		}
	}
}

using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;

namespace work01
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            var n = Int32.Parse (Console.ReadLine ());

            var l1 = n > 4 ? (n + 1) / 3 : n > 0 ? 1 : 0;
            var l2 = n > 4 ? n / 3 : n > 1 ? 1 : 0;
            var l3 = n > 2 ? 1 : 0;
            var l4 = n > 4 ? (n - 1) / 3 : n > 3 ? 1 : 0;

            Func <int, int, string> print = (k, m) => {
                var sb = new StringBuilder();
                for (var i = 1; i <= m; i++) {
                    sb.AppendFormat("{0}.", (i <= k) ? "0" : "#" );
                }
                return sb.ToString();
            };

            Console.WriteLine("+------------------------+");
            Console.WriteLine("|{0}|D|)", print(l1, 11));
            Console.WriteLine("|{0}|.|", print(l2, 11));
            Console.WriteLine("|{0}......................|", print(l3, 1));
            Console.WriteLine("|{0}|.|)", print(l4, 11));
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int t = k;
            string s1 = "+------------------------+";
            string s2 = "|O.......................|";
            string s3 = "|#.......................|";
            string[,] mat = new string[3,11];
            k--;
            mat[0, 0] = "|";
            mat[1, 0] = "|";
            mat[2, 0] = "|";
            for (int i = 0; i < 11; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (k > 0)
                    { mat[j, i] += "O"; k--; }
                    else
                        mat[j, i] += "#";
                }
            }
            Console.WriteLine(s1);
            for (int i = 0; i < 3; i++)
            {
                if (i == 2)
                Console.WriteLine((t>3)?s2:s3);
                for (int j = 0; j < 11; j++)
                {
                    Console.Write(mat[i, j] + ".");
                }
                if (i == 0)
                    Console.Write("|D|)");
                else
                    if (i == 2)
                        Console.Write("|.|)");
                else
                        Console.Write("|.|");
                Console.WriteLine();
            }
            Console.WriteLine(s1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            /*  int k = Convert.ToInt32(Console.ReadLine());
              char[,] mas = new char[4, 11];

              for (int i = 0; i < 4; i++)
              {
                  for (int j = 0; j < 11; j++)
                      mas[i, j] = '#';

              }
              for (int i = 1; i < 11; i++)
                  mas[2, i] = '.';

              for (int i = 0; i < 4; i++)
                  for (int j = 0; j < 11;j++ )
                      if (k > 0 && mas[i, j] != '.')
                      { k--; mas[i, j] = '0'; }

              Console.WriteLine("+------------------------+");
              Console.Write('|');
              for (int i = 0; i < 11;i++ )
                  Console.Write(mas[0,i].ToString() +'.');
              Console.WriteLine("|D|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("|.|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("..|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("|.|)");

                  Console.WriteLine("+------------------------+");*/

            int k = Convert.ToInt32(Console.ReadLine());
            if (k < 5)
            {
                Console.WriteLine("+------------------------+");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|D|)");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                if (k > 0) { Console.WriteLine("|O.......................|)"); k--; }
                else Console.WriteLine("|#.......................|)");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                Console.WriteLine("+------------------------+");
                return;
            }
            k = k - 4;
            Console.WriteLine("+------------------------+");
            for (int i = 0; i < 2; i++)
            {
                Console.Write("|O.");
                for (int j = 0; j < 10; j++)
                {
                    if (3 * j + i < k) Console.Write("O.");
                    else Console.Write("#.");
                }
                if (i == 0) Console.Write("|D|");
                else Console.Write("|.|");
                Console.WriteLine();
            }
            Console.WriteLine("|O.......................|");

            Console.Write("|O.");
            for (int i = 0; i < 10; i++)
                if (3 * i + 2 < k) Console.Write("O.");
                else Console.Write("#.");
            Console.Write("|.|");
            Console.WriteLine();
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            /*  int k = Convert.ToInt32(Console.ReadLine());
              char[,] mas = new char[4, 11];

              for (int i = 0; i < 4; i++)
              {
                  for (int j = 0; j < 11; j++)
                      mas[i, j] = '#';

              }
              for (int i = 1; i < 11; i++)
                  mas[2, i] = '.';

              for (int i = 0; i < 4; i++)
                  for (int j = 0; j < 11;j++ )
                      if (k > 0 && mas[i, j] != '.')
                      { k--; mas[i, j] = '0'; }

              Console.WriteLine("+------------------------+");
              Console.Write('|');
              for (int i = 0; i < 11;i++ )
                  Console.Write(mas[0,i].ToString() +'.');
              Console.WriteLine("|D|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("|.|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("..|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("|.|)");

                  Console.WriteLine("+------------------------+");*/

            int k = Convert.ToInt32(Console.ReadLine());
            if (k < 5)
            {
                Console.WriteLine("+------------------------+");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|D|)");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                if (k > 0) { Console.WriteLine("|O.......................|)"); k--; }
                else Console.WriteLine("|#.......................|)");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                Console.WriteLine("+------------------------+");
                return;
            }
            k = k - 4;
            Console.WriteLine("+------------------------+");
            for (int i = 0; i < 2; i++)
            {
                Console.Write("|O.");
                for (int j = 0; j < 10; j++)
                {
                    if (3 * j + i < k) Console.Write("O.");
                    else Console.Write("#.");
                }
                if (i == 0) Console.Write("|D|)");
                else Console.Write("|.|");
                Console.WriteLine();
            }
            Console.WriteLine("|O.......................|");

            Console.Write("|O.");
            for (int i = 0; i < 10; i++)
                if (3 * i + 2 < k) Console.Write("O.");
                else Console.Write("#.");
            Console.Write("|.|)");
            Console.WriteLine();
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace codeforces_475a
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int num = k;
            Console.WriteLine("+------------------------+");
            string s1 = "|", s2 = "|", s3 = "|", s4 = "|";
            if (k <= 4)
            {
                switch (k)
                {
                    case 1:
                        s1 += "O.";
                        break;
                    case 2:
                        s1 += "O.";
                        s2 += "O.";
                        break;
                    case 3:
                        s1 += "O.";
                        s2 += "O.";
                        s3 += "O.......................|";
                        break;
                    case 4:
                        s1 += "O.";
                        s2 += "O.";
                        s3 += "O.......................|";
                        s4 += "O.";
                        break;
                }
            }
            else
            {
                s1 += "O.";
                s2 += "O.";
                s3 += "O.......................|";
                s4 += "O.";
                k -= 4;
                int n = k / 3;
                if (n != 0)
                {
                    s1 += string.Concat(Enumerable.Repeat("O.", n));
                    s2 += string.Concat(Enumerable.Repeat("O.", n));
                    s4 += string.Concat(Enumerable.Repeat("O.", n));
                    k = k % 3;
                }
                switch (k)
                {
                    case 1:
                        s1 += "O.";
                        s2 += "#.";
                        s4 += "#.";
                        break;
                    case 2:
                        s1 += "O.";
                        s2 += "O.";
                        s4 += "#.";
                        break;
                    case 3:
                        s1 += "O.";
                        s2 += "O.";
                        s4 += "O.";
                        break;
                }
                s1 += string.Concat(Enumerable.Repeat("#.", (11 - ((s1.Length - 1) / 2)))) + "|D|)";
                s2 += string.Concat(Enumerable.Repeat("#.", (11 - ((s2.Length - 1) / 2)))) + "|.|";
                s4 += string.Concat(Enumerable.Repeat("#.", (11 - ((s4.Length - 1) / 2)))) + "|.|)";
                Console.WriteLine(s1);
                Console.WriteLine(s2);
                Console.WriteLine(s3);
                Console.WriteLine(s4);
                Console.WriteLine("+------------------------+");
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace codeforces_475a
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            if (k > 34)
                k = 34;
            Console.WriteLine("+------------------------+");
            string s1 = "|", s2 = "|", s3 = "|", s4 = "|";
            if (k <= 4)
            {
                switch (k)
                {
                    case 1:
                        s1 += "O.";
                        break;
                    case 2:
                        s1 += "O.";
                        s2 += "O.";
                        break;
                    case 3:
                        s1 += "O.";
                        s2 += "O.";
                        s3 += "O.......................|";
                        break;
                    case 4:
                        s1 += "O.";
                        s2 += "O.";
                        s3 += "O.......................|";
                        s4 += "O.";
                        break;
                }
            }
            else
            {
                s1 += "O.";
                s2 += "O.";
                s3 += "O.......................|";
                s4 += "O.";
                k -= 4;
                int n = k / 3;
                if (n != 0)
                {
                    s1 += string.Concat(Enumerable.Repeat("O.", n));
                    s2 += string.Concat(Enumerable.Repeat("O.", n));
                    s4 += string.Concat(Enumerable.Repeat("O.", n));
                    k = k % 3;
                }
                switch (k)
                {
                    case 1:
                        s1 += "O.";
                        s2 += "#.";
                        s4 += "#.";
                        break;
                    case 2:
                        s1 += "O.";
                        s2 += "O.";
                        s4 += "#.";
                        break;
                    case 3:
                        s1 += "O.";
                        s2 += "O.";
                        s4 += "O.";
                        break;
                }
                s1 += string.Concat(Enumerable.Repeat("#.", (11 - ((s1.Length - 1) / 2)))) + "|D|)";
                s2 += string.Concat(Enumerable.Repeat("#.", (11 - ((s2.Length - 1) / 2)))) + "|.|";
                s4 += string.Concat(Enumerable.Repeat("#.", (11 - ((s4.Length - 1) / 2)))) + "|.|)";
                Console.WriteLine(s1);
                Console.WriteLine(s2);
                Console.WriteLine(s3);
                Console.WriteLine(s4);
                Console.WriteLine("+------------------------+");
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = Convert.ToInt16(Console.ReadLine());

            Console.WriteLine("+------------------------+");
            if (x < 1) Console.Write("|#.");
            else Console.Write("|0.");
            for (int m = 5; m <= 32; m = m + 3)
            {
                if (x >= m) Console.Write("0.");
                else Console.Write("#.");
            }

            Console.Write("|D|)\n");
            if (x < 2) Console.Write("|#.");
            else Console.Write("|0.");
            for (int m = 6; m <= 33; m = m + 3)
            {
                if (x >= m) Console.Write("0.");
                else Console.Write("#.");
            }

            Console.Write("|.|)\n");
            if (x < 3) Console.WriteLine("|#.......................|");
            else Console.WriteLine("|0.......................|");

            if (x < 4) Console.Write("|#.");
            else Console.Write("|0.");
            for (int m = 7; m <= 34; m = m + 3)
            {
                if (x >= m) Console.Write("0.");
                else Console.Write("#.");
            }
            Console.Write("|.|)\n");
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = Convert.ToInt16(Console.ReadLine());

            Console.WriteLine("+------------------------+");
            if (x < 1) Console.Write("|#.");
            else Console.Write("|O.");
            for (int m = 5; m <= 32; m = m + 3)
            {
                if (x >= m) Console.Write("O.");
                else Console.Write("#.");
            }

            Console.Write("|D|)\n");
            if (x < 2) Console.Write("|#.");
            else Console.Write("|O.");
            for (int m = 6; m <= 33; m = m + 3)
            {
                if (x >= m) Console.Write("O.");
                else Console.Write("#.");
            }

            Console.Write("|.|)\n");
            if (x < 3) Console.WriteLine("|#.......................|");
            else Console.WriteLine("|O.......................|");

            if (x < 4) Console.Write("|#.");
            else Console.Write("|O.");
            for (int m = 7; m <= 34; m = m + 3)
            {
                if (x >= m) Console.Write("O.");
                else Console.Write("#.");
            }
            Console.Write("|.|)\n");
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeForces
{
    class Program
    {

        static void Main(string[] args)
        {

            int k = Convert.ToInt32(Console.ReadLine());
            int counter = 0;

            string[,] Arr = new string[4, 11] { {"#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"},
                                                {"#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"},
                                                {"#", ".", ".", ".", ".", ".", ".", ".", ".", ".", "."},
                                                {"#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"},
                                                                                };

            bool floopbreak = false;

            for (int i = 0; (!floopbreak) && i < 11; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (j == 2 && i > 0)
                    {
                        continue;
                    }

                    Arr[j, i] = "0";

                    counter++;
                    if (counter == k)
                    {
                        floopbreak = true;
                        break;
                    }
                }

            }

                Console.WriteLine("+------------------------+");
                Console.Write("|");

                for (int i = 0; i < 11; i++)
                {
                    Console.Write(Arr[0,i]+".");
                }

                Console.WriteLine("|D|)");
                Console.Write("|");
                for (int i = 0; i < 11; i++)
                {
                    Console.Write(Arr[1, i] + ".");
                }

                Console.WriteLine("|.|");

                Console.Write("|");
                Console.Write(Arr[2, 0]);
                Console.WriteLine(".......................|");

                Console.Write("|");
                for (int i = 0; i < 11; i++)
                {
                    Console.Write(Arr[3, i] + ".");
                }
                Console.WriteLine("|.|)");

                Console.WriteLine("+------------------------+");

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeForces
{
    class Program
    {

        static void Main(string[] args)
        {

            int k = Convert.ToInt32(Console.ReadLine());
            int counter = 0;

            string[,] Arr = new string[4, 11] { {"#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"},
                                                {"#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"},
                                                {"#", ".", ".", ".", ".", ".", ".", ".", ".", ".", "."},
                                                {"#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"},
                                                                                };

            bool floopbreak = false;

            for (int i = 0; (!floopbreak) && i < 11; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (j == 2 && i > 0)
                    {
                        continue;
                    }

                    Arr[j, i] = "O";

                    counter++;
                    if (counter == k)
                    {
                        floopbreak = true;
                        break;
                    }
                }

            }

                Console.WriteLine("+------------------------+");
                Console.Write("|");

                for (int i = 0; i < 11; i++)
                {
                    Console.Write(Arr[0,i]+".");
                }

                Console.WriteLine("|D|)");
                Console.Write("|");
                for (int i = 0; i < 11; i++)
                {
                    Console.Write(Arr[1, i] + ".");
                }

                Console.WriteLine("|.|");

                Console.Write("|");
                Console.Write(Arr[2, 0]);
                Console.WriteLine(".......................|");

                Console.Write("|");
                for (int i = 0; i < 11; i++)
                {
                    Console.Write(Arr[3, i] + ".");
                }
                Console.WriteLine("|.|)");

                Console.WriteLine("+------------------------+");

        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
           // StreamReader sr = new StreamReader("11.in");
            //StreamWriter sw = new StreamWriter("11.out");

            int n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("+------------------------+");

            for (int j = 0; j < 4; j++)
            {
                Console.Write("|");
                for (int i = 0; i < 11 || (i < 1 && j == 1); i++)
                    Console.Write(seat(n, j, i) + ".");
                Console.WriteLine("." + (j == 2 ? "." : "|") + (j == 0 ? "D" : ".") + "|");
            }

            Console.WriteLine("+------------------------+");
            Console.ReadLine();
        }

        static string seat(int k,int i,int j)
        {
            if (i == 2  && j>0)
                return ".";
            if (k > 4 && j == 0)
                return "O";
            if (k <= 4 && j==0)
                return k>i? "O":"#";

            k-=4; j--; i= i == 3 ? 2 : i;
            return k > j * 3 + i ? "O" : "#";
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
           // StreamReader sr = new StreamReader("11.in");
            //StreamWriter sw = new StreamWriter("11.out");

            int n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("+------------------------+");

            for (int j = 0; j < 4; j++)
            {
                Console.Write("|");
                for (int i = 0; i < 11 || (i < 1 && j == 1); i++)
                    Console.Write(seat(n, j, i) + ".");
                Console.WriteLine("." + (j == 2 ? "." : "|") + (j == 0 ? "D" : ".") + "|" + (j == 3 || j==0 ? ")" : ""));
            }

            Console.WriteLine("+------------------------+");
            Console.ReadLine();
        }

        static string seat(int k,int i,int j)
        {
            if (i == 2  && j>0)
                return ".";
            if (k > 4 && j == 0)
                return "O";
            if (k <= 4 && j==0)
                return k>i? "O":"#";

            k-=4; j--; i= i == 3 ? 2 : i;
            return k > j * 3 + i ? "O" : "#";
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bayan
{
    class Program
    {
        static List<string> Do(int PassengersCount)
        {
            List<string> Lines = new List<string>();

            var RowCount = 6;
            var ColumnCount = 27;
            var Bus = new char[RowCount, ColumnCount];

            for (int row = 0; row < RowCount; row++)
            {
                string line = "";

                for (int column = 0; column < ColumnCount; column++)
                {
                    if (row == 0 || row == RowCount - 1)
                    {
                        if (column == 0 || column == (ColumnCount - 2))
                            Bus[row, column] = '+';
                        else if (column == (ColumnCount - 1))
                            Bus[row, column] = ' ';
                        else
                            Bus[row, column] = '-';
                    }
                    else
                    {
                        // ستون های ردیف های 1 تا 4
                        if (column == 0)
                            Bus[row, column] = '|';
                        else
                        {
                            if (column < 23)
                            {
                                if (column == 1)
                                {
                                    Bus[row, column] = '#';
                                }
                                else
                                {
                                    if (row == 3)
                                        Bus[row, column] = '.';
                                    else
                                    {
                                        var isOdd = column % 2 == 1;
                                        if (isOdd)
                                        {
                                            Bus[row, column] = '#';
                                        }
                                        else
                                        {
                                            Bus[row, column] = '.';
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (column == 23)
                                {
                                    if (row != 3)
                                        Bus[row, column] = '|';
                                    else
                                        Bus[row, column] = '.';
                                }
                                else if (column == 24)
                                {
                                    if (row == 1)
                                        Bus[row, column] = 'D';
                                    else
                                        Bus[row, column] = '.';
                                }
                                else if (column == 25)
                                {
                                    Bus[row, column] = '|';
                                }
                                else if (column == 26)
                                {
                                    if (row == 1 || row == 4)
                                        Bus[row, column] = ')';
                                    else
                                        Bus[row, column] = ' ';
                                }
                            }
                        }

                    }

                    var s = Bus[row, column].ToString();
                    line = line + s;
                }

                Lines.Add(line);
            }

            //PassengersCount

            var c = 0;

            string[] BusArray = Lines.ToArray();

            while (PassengersCount != 0)
            {
                var ss = BusArray[c];

                if (c >= 1 && c <= 4)
                {
                    if (c == 3)
                    {
                        var cc = ss.ToCharArray();
                        for (int i = 0; i < cc.Length; i++)
                        {
                            if (i == 1)
                            {
                                if (cc[i] == '#')
                                {
                                    cc[i] = 'O';
                                    PassengersCount--;
                                    ss = string.Join("", cc);
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        var cc = ss.ToCharArray();

                        for (int r = 0; r < cc.Length; r++)
                        {
                            if (cc[r] == '#')
                            {
                                cc[r] = 'O';
                                PassengersCount--;
                                break;
                            }
                        }

                        ss = string.Join("", cc);
                    }

                }

                BusArray[c] = ss;

                c++;

                if (c > 5)
                    c = 0;
            };

            return BusArray.ToList();
        }

        static void Main(string[] args)
        {
            try
            {
                var OutputLines = Do(int.Parse(Console.ReadLine()));
                Console.Write(string.Join("\n", OutputLines));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.Write(Environment.NewLine);
                Console.Write("any key to exit");
                Console.ReadKey();
            }
        }
    }

    #region Extensions

    public static class Extensions
    {
        public static void ForEach<T>(this IEnumerable<T> Collection, Action<T, int> Action)
        {
            var ListCollection = Collection.ToList();

            var Length = ListCollection.Count;
            for (int i = 0; i < Length; i++)
            {
                Action(ListCollection[i], i);
            }
        }
    }

    #endregion

    #region IO

    public class IO
    {
        #region Constructor

        public IO(string InputPath, string OutputPath)
        {
            this.InputPath = InputPath;
            this.OutputPath = OutputPath;
        }

        #endregion

        #region Properties

        public string InputPath { get; set; }
        public string OutputPath { get; set; }

        #endregion

        #region Read Public Methods

        public string Read()
        {
            string Text = string.Empty;
            using (StreamReader Reader = new StreamReader(this.InputPath))
                Text = Reader.ReadToEnd();

            return Text;
        }

        public List<string> ReadLines()
        {
            var Text = Read();
            var Lines = Text
                .Split('\n')
                .Where(u => !string.IsNullOrEmpty(u))
                .ToList();
            return Lines;
        }

        #endregion

        #region Write Public Methods

        public void Write(string Text)
        {
            using (StreamWriter Writer = new StreamWriter(this.OutputPath))
                Writer.Write(Text);
        }

        public void WriteLines(List<string> Lines)
        {
            var Text = String.Join(Environment.NewLine, Lines);
            Write(Text);
        }

        #endregion
    }

    #endregion
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bayan
{
    class Program
    {
        static List<string> Do(int PassengersCount)
        {
            List<string> Lines = new List<string>();

            var RowCount = 6;
            var ColumnCount = 27;
            var Bus = new char[RowCount, ColumnCount];

            for (int row = 0; row < RowCount; row++)
            {
                string line = "";

                for (int column = 0; column < ColumnCount; column++)
                {
                    if (row == 0 || row == RowCount - 1)
                    {
                        if (column == 0 || column == (ColumnCount - 2))
                            Bus[row, column] = '+';
                        else if (column == (ColumnCount - 1))
                            Bus[row, column] = ' ';
                        else
                            Bus[row, column] = '-';
                    }
                    else
                    {
                        // ستون های ردیف های 1 تا 4
                        if (column == 0)
                            Bus[row, column] = '|';
                        else
                        {
                            if (column < 23)
                            {
                                if (column == 1)
                                {
                                    Bus[row, column] = '#';
                                }
                                else
                                {
                                    if (row == 3)
                                        Bus[row, column] = '.';
                                    else
                                    {
                                        var isOdd = column % 2 == 1;
                                        if (isOdd)
                                        {
                                            Bus[row, column] = '#';
                                        }
                                        else
                                        {
                                            Bus[row, column] = '.';
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (column == 23)
                                {
                                    if (row != 3)
                                        Bus[row, column] = '|';
                                    else
                                        Bus[row, column] = '.';
                                }
                                else if (column == 24)
                                {
                                    if (row == 1)
                                        Bus[row, column] = 'D';
                                    else
                                        Bus[row, column] = '.';
                                }
                                else if (column == 25)
                                {
                                    Bus[row, column] = '|';
                                }
                                else if (column == 26)
                                {
                                    if (row == 1 || row == 4)
                                        Bus[row, column] = ')';
                                    else
                                        Bus[row, column] = ' ';
                                }
                            }
                        }

                    }

                    var s = Bus[row, column].ToString();
                    line = line + s;
                }

                Lines.Add(line);
            }

            //PassengersCount

            var c = 0;

            string[] BusArray = Lines.ToArray();

            while (PassengersCount != 0)
            {
                var ss = BusArray[c];

                if (c >= 1 && c <= 4)
                {
                    if (c == 3)
                    {
                        var cc = ss.ToCharArray();
                        for (int i = 0; i < cc.Length; i++)
                        {
                            if (i == 1)
                            {
                                if (cc[i] == '#')
                                {
                                    cc[i] = 'O';
                                    PassengersCount--;
                                    ss = string.Join("", cc);
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        var cc = ss.ToCharArray();

                        for (int r = 0; r < cc.Length; r++)
                        {
                            if (cc[r] == '#')
                            {
                                cc[r] = 'O';
                                PassengersCount--;
                                break;
                            }
                        }

                        ss = string.Join("", cc);
                    }

                }

                BusArray[c] = ss;

                c++;

                if (c > 5)
                    c = 0;
            };

            return BusArray.ToList();
        }

        static void Main(string[] args)
        {
            try
            {
                var OutputLines = Do(int.Parse(Console.ReadLine()));
                for (int i = 0; i < OutputLines.Count; i++)
                {
                    Console.Write(OutputLines[i]);
                    if (i < OutputLines.Count)
                        Console.WriteLine();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.Write(Environment.NewLine);
                Console.Write("any key to exit");
                Console.ReadKey();
            }
        }
    }

    #region Extensions

    public static class Extensions
    {
        public static void ForEach<T>(this IEnumerable<T> Collection, Action<T, int> Action)
        {
            var ListCollection = Collection.ToList();

            var Length = ListCollection.Count;
            for (int i = 0; i < Length; i++)
            {
                Action(ListCollection[i], i);
            }
        }
    }

    #endregion

    #region IO

    public class IO
    {
        #region Constructor

        public IO(string InputPath, string OutputPath)
        {
            this.InputPath = InputPath;
            this.OutputPath = OutputPath;
        }

        #endregion

        #region Properties

        public string InputPath { get; set; }
        public string OutputPath { get; set; }

        #endregion

        #region Read Public Methods

        public string Read()
        {
            string Text = string.Empty;
            using (StreamReader Reader = new StreamReader(this.InputPath))
                Text = Reader.ReadToEnd();

            return Text;
        }

        public List<string> ReadLines()
        {
            var Text = Read();
            var Lines = Text
                .Split('\n')
                .Where(u => !string.IsNullOrEmpty(u))
                .ToList();
            return Lines;
        }

        #endregion

        #region Write Public Methods

        public void Write(string Text)
        {
            using (StreamWriter Writer = new StreamWriter(this.OutputPath))
                Writer.Write(Text);
        }

        public void WriteLines(List<string> Lines)
        {
            var Text = String.Join(Environment.NewLine, Lines);
            Write(Text);
        }

        #endregion
    }

    #endregion
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bayan
{
    class Program
    {
        static List<string> Do(int PassengersCount)
        {
            List<string> Lines = new List<string>();

            var RowCount = 6;
            var ColumnCount = 27;
            var Bus = new char[RowCount, ColumnCount];

            for (int row = 0; row < RowCount; row++)
            {
                string line = "";

                for (int column = 0; column < ColumnCount; column++)
                {
                    if (row == 0 || row == RowCount - 1)
                    {
                        if (column == 0 || column == (ColumnCount - 2))
                            Bus[row, column] = '+';
                        else if (column == (ColumnCount - 1))
                            Bus[row, column] = ' ';
                        else
                            Bus[row, column] = '-';
                    }
                    else
                    {
                        // ستون های ردیف های 1 تا 4
                        if (column == 0)
                            Bus[row, column] = '|';
                        else
                        {
                            if (column < 23)
                            {
                                if (column == 1)
                                {
                                    Bus[row, column] = '#';
                                }
                                else
                                {
                                    if (row == 3)
                                        Bus[row, column] = '.';
                                    else
                                    {
                                        var isOdd = column % 2 == 1;
                                        if (isOdd)
                                        {
                                            Bus[row, column] = '#';
                                        }
                                        else
                                        {
                                            Bus[row, column] = '.';
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (column == 23)
                                {
                                    if (row != 3)
                                        Bus[row, column] = '|';
                                    else
                                        Bus[row, column] = '.';
                                }
                                else if (column == 24)
                                {
                                    if (row == 1)
                                        Bus[row, column] = 'D';
                                    else
                                        Bus[row, column] = '.';
                                }
                                else if (column == 25)
                                {
                                    Bus[row, column] = '|';
                                }
                                else if (column == 26)
                                {
                                    if (row == 1 || row == 4)
                                        Bus[row, column] = ')';
                                    else
                                        Bus[row, column] = ' ';
                                }
                            }
                        }

                    }

                    var s = Bus[row, column].ToString();
                    line = line + s;
                }

                Lines.Add(line);
            }

            //PassengersCount

            var c = 0;

            string[] BusArray = Lines.ToArray();

            while (PassengersCount != 0)
            {
                var ss = BusArray[c];

                if (c >= 1 && c <= 4)
                {
                    if (c == 3)
                    {
                        var cc = ss.ToCharArray();
                        for (int i = 0; i < cc.Length; i++)
                        {
                            if (i == 1)
                            {
                                if (cc[i] == '#')
                                {
                                    cc[i] = 'O';
                                    PassengersCount--;
                                    ss = string.Join("", cc);
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        var cc = ss.ToCharArray();

                        for (int r = 0; r < cc.Length; r++)
                        {
                            if (cc[r] == '#')
                            {
                                cc[r] = 'O';
                                PassengersCount--;
                                break;
                            }
                        }

                        ss = string.Join("", cc);
                    }

                }

                BusArray[c] = ss;

                c++;

                if (c > 5)
                    c = 0;
            };

            return BusArray.ToList();
        }

        static void Main(string[] args)
        {
            try
            {
                var OutputLines = Do(int.Parse(Console.ReadLine()));

                OutputLines.ForEach(u => Console.WriteLine(u));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.Write(Environment.NewLine);
                Console.Write("any key to exit");
                Console.ReadKey();
            }
        }
    }

    #region Extensions

    public static class Extensions
    {
        public static void ForEach<T>(this IEnumerable<T> Collection, Action<T, int> Action)
        {
            var ListCollection = Collection.ToList();

            var Length = ListCollection.Count;
            for (int i = 0; i < Length; i++)
            {
                Action(ListCollection[i], i);
            }
        }
    }

    #endregion

    #region IO

    public class IO
    {
        #region Constructor

        public IO(string InputPath, string OutputPath)
        {
            this.InputPath = InputPath;
            this.OutputPath = OutputPath;
        }

        #endregion

        #region Properties

        public string InputPath { get; set; }
        public string OutputPath { get; set; }

        #endregion

        #region Read Public Methods

        public string Read()
        {
            string Text = string.Empty;
            using (StreamReader Reader = new StreamReader(this.InputPath))
                Text = Reader.ReadToEnd();

            return Text;
        }

        public List<string> ReadLines()
        {
            var Text = Read();
            var Lines = Text
                .Split('\n')
                .Where(u => !string.IsNullOrEmpty(u))
                .ToList();
            return Lines;
        }

        #endregion

        #region Write Public Methods

        public void Write(string Text)
        {
            using (StreamWriter Writer = new StreamWriter(this.OutputPath))
                Writer.Write(Text);
        }

        public void WriteLines(List<string> Lines)
        {
            var Text = String.Join(Environment.NewLine, Lines);
            Write(Text);
        }

        #endregion
    }

    #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bayan
{
    class Program
    {
        static void Main(string[] args)
        {

            String[] lastRow = new String[4];
            int lastRowFillCounter = 0;
            String[,] remainingRows = new String[10, 3];
            String input = Console.ReadLine();
            int inputNumber = Convert.ToInt32(input);
            for (int i = 0; i < lastRow.Length; i++)
            {
                lastRow[i] = "#";
            }
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    remainingRows[i, j] = "#";
                }
            }
            int lastRowIndex = 0;
            int remainRowFirstIndex = 0;
            int remainRowSecondIndex = 0;
            for (int k = 0; k < inputNumber; k++)
            {
                if (lastRowFillCounter < 4)
                {
                    lastRow[lastRowFillCounter] = "0";
                    lastRowFillCounter++;
                }
                else
                {
                    if (remainRowSecondIndex > 2)
                    {
                        remainRowSecondIndex = 0;
                        remainRowFirstIndex++;
                    }

                    remainingRows[remainRowFirstIndex, remainRowSecondIndex] = "0";
                    remainRowSecondIndex++;
                }
            }
            String firstAnswer = "+------------------------+";
            string firstRowAnswer = "|" + lastRow[0];
            for (int i = 0; i < 10; i++)
            {
                firstRowAnswer = firstRowAnswer + "." + remainingRows[i, 0];
            }
            firstRowAnswer = firstRowAnswer + ".|D|)";

            String secondRowAnswer = "|" + lastRow[1];
            for (int i = 0; i < 10; i++)
            {
                secondRowAnswer = secondRowAnswer + "." + remainingRows[i, 1];
            }
            secondRowAnswer = secondRowAnswer + ".|.|";

            String thirdRowAnswer = "|" + lastRow[2] + ".......................|";

            String forthRowAnswer = "|" + lastRow[3];
            for (int i = 0; i < 10; i++)
            {
                forthRowAnswer = forthRowAnswer + "." + remainingRows[i, 2];
            }
            forthRowAnswer = forthRowAnswer + ".|D|)";

            String endLine = "+------------------------+";
            Console.WriteLine(firstAnswer);
            Console.WriteLine(firstRowAnswer);
            Console.WriteLine(secondRowAnswer);
            Console.WriteLine(thirdRowAnswer);
            Console.WriteLine(forthRowAnswer);
            Console.WriteLine(endLine);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bayan
{
    class Program
    {
        static void Main(string[] args)
        {

            String[] lastRow = new String[4];
            int lastRowFillCounter = 0;
            String[,] remainingRows = new String[10, 3];
            String input = Console.ReadLine();
            int inputNumber = Convert.ToInt32(input);
            for (int i = 0; i < lastRow.Length; i++)
            {
                lastRow[i] = "#";
            }
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    remainingRows[i, j] = "#";
                }
            }
            int lastRowIndex = 0;
            int remainRowFirstIndex = 0;
            int remainRowSecondIndex = 0;
            for (int k = 0; k < inputNumber; k++)
            {
                if (lastRowFillCounter < 4)
                {
                    lastRow[lastRowFillCounter] = "O";
                    lastRowFillCounter++;
                }
                else
                {
                    if (remainRowSecondIndex > 2)
                    {
                        remainRowSecondIndex = 0;
                        remainRowFirstIndex++;
                    }

                    remainingRows[remainRowFirstIndex, remainRowSecondIndex] = "O";
                    remainRowSecondIndex++;
                }
            }
            String firstAnswer = "+------------------------+";
            string firstRowAnswer = "|" + lastRow[0];
            for (int i = 0; i < 10; i++)
            {
                firstRowAnswer = firstRowAnswer + "." + remainingRows[i, 0];
            }
            firstRowAnswer = firstRowAnswer + ".|D|)";

            String secondRowAnswer = "|" + lastRow[1];
            for (int i = 0; i < 10; i++)
            {
                secondRowAnswer = secondRowAnswer + "." + remainingRows[i, 1];
            }
            secondRowAnswer = secondRowAnswer + ".|.|";

            String thirdRowAnswer = "|" + lastRow[2] + ".......................|";

            String forthRowAnswer = "|" + lastRow[3];
            for (int i = 0; i < 10; i++)
            {
                forthRowAnswer = forthRowAnswer + "." + remainingRows[i, 2];
            }
            forthRowAnswer = forthRowAnswer + ".|D|)";

            String endLine = "+------------------------+";
            Console.WriteLine(firstAnswer);
            Console.WriteLine(firstRowAnswer);
            Console.WriteLine(secondRowAnswer);
            Console.WriteLine(thirdRowAnswer);
            Console.WriteLine(forthRowAnswer);
            Console.WriteLine(endLine);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bayan
{
    class Program
    {
        static void Main(string[] args)
        {

            String[] lastRow = new String[4];
            int lastRowFillCounter = 0;
            String[,] remainingRows = new String[10, 3];
            String input = Console.ReadLine();
            int inputNumber = Convert.ToInt32(input);
            for (int i = 0; i < lastRow.Length; i++)
            {
                lastRow[i] = "#";
            }
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    remainingRows[i, j] = "#";
                }
            }
            int lastRowIndex = 0;
            int remainRowFirstIndex = 0;
            int remainRowSecondIndex = 0;
            for (int k = 0; k < inputNumber; k++)
            {
                if (lastRowFillCounter < 4)
                {
                    lastRow[lastRowFillCounter] = "0";
                    lastRowFillCounter++;
                }
                else
                {
                    if (remainRowSecondIndex > 2)
                    {
                        remainRowSecondIndex = 0;
                        remainRowFirstIndex++;
                    }

                    remainingRows[remainRowFirstIndex, remainRowSecondIndex] = "0";
                    remainRowSecondIndex++;
                }
            }
            String firstAnswer = "+------------------------+";
            string firstRowAnswer = "|" + lastRow[0];
            for (int i = 0; i < 10; i++)
            {
                firstRowAnswer = firstRowAnswer + "." + remainingRows[i, 0];
            }
            firstRowAnswer = firstRowAnswer + ".|D|)";

            String secondRowAnswer = "|" + lastRow[1];
            for (int i = 0; i < 10; i++)
            {
                secondRowAnswer = secondRowAnswer + "." + remainingRows[i, 1];
            }
            secondRowAnswer = secondRowAnswer + ".|.|";

            String thirdRowAnswer = "|" + lastRow[2] + ".......................|";

            String forthRowAnswer = "|" + lastRow[3];
            for (int i = 0; i < 10; i++)
            {
                forthRowAnswer = forthRowAnswer + "." + remainingRows[i, 2];
            }
            forthRowAnswer = forthRowAnswer + ".|D|)";

            String endLine = "+------------------------+";
            Console.WriteLine(firstAnswer);
            Console.WriteLine(firstRowAnswer);
            Console.WriteLine(secondRowAnswer);
            Console.WriteLine(thirdRowAnswer);
            Console.WriteLine(forthRowAnswer);
            Console.WriteLine(endLine);
            Console.ReadLine();

        }
    }
}

using System;
using System.Linq;

namespace CodeForces
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			string line1 = Console.ReadLine();
			int n = Int32.Parse(line1);
			int[,] columns = new int[11 , 4];
			if (n >= 4)
			{
				n -= 4;
				for (int i = 0; i < 4; i++)
				{
					columns[0, i] = 1;
				}
				int column = 1;
				int row = 0;
				while (n > 0)
				{
					n -= 1;
					columns[column, row] = 1;
					row += 1;
					if (row == 2)
					{
						row += 1;
					}
					if (row == 4)
					{
						row = 0;
						column += 1;
					}
				}
			}
			else
			{
				if (n == 3)
				{
					for (int i = 0; i < 3; i++)
					{
						columns[0, i] = 1;
					}
				}
				else if (n == 2)
				{
					for (int i = 0; i < 2; i++)
					{
						columns[0, i] = 1;
					}
				}
				else if (n == 1)
				{
					for (int i = 0; i < 1; i++)
					{
						columns[0, i] = 1;
					}
				}
				else
				{

				}
			}
			Console.WriteLine("+------------------------+");
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 0] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("#.");
				}
			}
			Console.Write("|D|)" + Environment.NewLine);
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 1] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("#.");
				}
			}
			Console.Write("|.|" + Environment.NewLine);
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 2] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("..");
				}
			}
			Console.Write("|.|" + Environment.NewLine);
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 3] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("#.");
				}
			}
			Console.Write("|.|)" + Environment.NewLine);
			Console.WriteLine("+------------------------+");

		}

	}

}

using System;
using System.Linq;

namespace CodeForces
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			string line1 = Console.ReadLine();
			int n = Int32.Parse(line1);
			int[,] columns = new int[11 , 4];
			if (n >= 4)
			{
				n -= 4;
				for (int i = 0; i < 4; i++)
				{
					columns[0, i] = 1;
				}
				int column = 1;
				int row = 0;
				while (n > 0)
				{
					n -= 1;
					columns[column, row] = 1;
					row += 1;
					if (row == 2)
					{
						row += 1;
					}
					if (row == 4)
					{
						row = 0;
						column += 1;
					}
				}
			}
			else
			{
				if (n == 3)
				{
					for (int i = 0; i < 3; i++)
					{
						columns[0, i] = 1;
					}
				}
				else if (n == 2)
				{
					for (int i = 0; i < 2; i++)
					{
						columns[0, i] = 1;
					}
				}
				else if (n == 1)
				{
					for (int i = 0; i < 1; i++)
					{
						columns[0, i] = 1;
					}
				}
				else
				{

				}
			}
			Console.WriteLine("+------------------------+");
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 0] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("#.");
				}
			}
			Console.Write("|D|)" + Environment.NewLine);
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 1] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("#.");
				}
			}
			Console.Write("|.|" + Environment.NewLine);
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 2] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("..");
				}
			}
			Console.Write("..|" + Environment.NewLine);
			Console.Write("|");
			for (int i = 0; i < 11; i++)
			{
				if (columns[i, 3] == 1)
				{
					Console.Write("O.");
				}
				else
				{
					Console.Write("#.");
				}
			}
			Console.Write("|.|)" + Environment.NewLine);
			Console.WriteLine("+------------------------+");

		}

	}

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[1, 13] = "D";

            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "-";
                bus[5, i] = "-";
            }

            for (int i = 2; i <= 12; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "O";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    Console.Write(bus[i, j]);
                }
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            string[] output = new string[6];
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[1, 12] = "|D";
            bus[1, 13] = "|";
            bus[2, 12] = "|.";
            bus[2, 13] = "|";
            bus[4, 12] = "|.";
            bus[4, 13] = "|";
            bus[3, 13] = "|";
            for (int i = 1; i < 5; i++)
            {
                bus[i, 0] = "|";
            }

            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "- ";
                bus[5, i] = "- ";
            }

            for (int i = 2; i <= 11; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "O.";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#.";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    output[i] += bus[i, j];

                }
                if ((i == 1) || (i == 4))
                {
                    Console.Write(output[i] + ')');
                }
                else
                {
                    Console.Write(output[i]);
                }
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";

            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "-";
                bus[5, i] = "-";
            }

            for (int i = 2; i <= 12; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "O";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    Console.Write(bus[i, j]);
                }
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[1, 13] = "D";

            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "-";
                bus[5, i] = "-";
            }

            for (int i = 2; i <= 11; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "O";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    Console.Write(bus[i, j]);
                }
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[2, 13] = "|";
            bus[2, 12] = "|.";
            bus[1, 12] = "|D";
            bus[4, 13] = "|";
            bus[4, 12] = "|.";
            bus[3, 13] = "|";
            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "-";
                bus[5, i] = "-";
            }
            for (int i = 1; i < 5; i++)
            {
                bus[i, 0] = "|";
                bus[i, 13] = "|";
            }
            for (int i = 2; i <= 12; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "0.";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#.";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    Console.Write(bus[i, j]);
                }
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";

            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "-";
                bus[5, i] = "-";
            }

            for (int i = 2; i <= 12; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "O.";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#.";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    Console.Write(bus[i, j]);
                }
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[2, 13] = "|";
            bus[2, 12] = "|.";
            bus[1, 12] = "|D";
            bus[4, 13] = "|";
            bus[4, 12] = "|.";
            bus[3, 13] = "|";
            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "-";
                bus[5, i] = "-";
            }
            for (int i = 1; i < 5; i++)
            {
                bus[i, 0] = "|";
                bus[i, 13] = "|";
            }
            for (int i = 2; i <= 12; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "o.";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#.";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    Console.Write(bus[i, j]);
                }
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            string[] output = new string[6];
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[1, 13] = "D";

            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "-";
                bus[5, i] = "-";
            }

            for (int i = 2; i <= 11; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "O";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    output[i] += bus[i, j];

                }
                Console.Write(output[i]);
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[1, 13] = "D";

            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "-";
                bus[5, i] = "-";
            }

            for (int i = 2; i <= 12; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "O.";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#.";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    Console.Write(bus[i, j]);
                }
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            string[] output = new string[6];
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[1, 12] = "|D";
            bus[1, 13] = "|";
            bus[2, 12] = "|.";
            bus[2, 13] = "|";
            bus[4, 12] = "|.";
            bus[4, 13] = "|";
            bus[3, 13] = "|";
            for (int i = 1; i < 5; i++)
            {
                bus[i, 0] = "|";
            }

            for (int i = 2; i <= 11; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "O.";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#.";
                    }

                }

            }

            Console.Write('+');
            for (int l = 1; l < 25; l++)
            {
                Console.Write('-');
            }
            Console.Write('+');
            for (int i = 1; i < 5; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    output[i] += bus[i, j];

                }

                if ((i == 1) || (i == 4))
                {
                    Console.Write(output[i] + ')');
                }
                else
                {
                    Console.Write(output[i]);
                }
            }
            Console.WriteLine();
            Console.Write('+');
            for (int l = 1; l < 25; l++)
            {
                Console.Write('-');
            }
            Console.Write('+');

            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            string[,] bus = new string[6, 14];
            int n = 0;
            string[] output = new string[6];
            n = count;
            bus[0, 0] = "+";
            bus[5, 0] = "+";
            bus[0, 13] = "+";
            bus[5, 13] = "+";
            bus[1, 12] = "|D";
            bus[1, 13] = "|";
            bus[2, 12] = "|.";
            bus[2, 13] = "|";
            bus[4, 12] = "|.";
            bus[4, 13] = "|";
            bus[3, 13] = "|";
            for (int i = 1; i < 5; i++)
            {
                bus[i, 0] = "|";
            }

            for (int i = 1; i < 13; i++)
            {
                bus[0,i] = "-";
                bus[5, i] = "-";
            }

            for (int i = 2; i <= 11; i++)
            {
                bus[3, i] = ".";
            }
            for (int i = 1; i <= 11; i++)
            {
                for (int j = 1; j < 5; j++)
                {
                    if ((bus[j,i] != ".") && (n != 0) )
                    {
                        bus[j, i] = "O.";
                        n--;
                    }
                    else if ( (bus[j,i] != "."))
                    {
                        bus[j, i] = "#.";
                    }

                }

            }

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine();
                for (int j  = 0; j < 14; j++)
                {
                    output[i] += bus[i, j];

                }
                if ((i == 1) || (i == 4))
                {
                    Console.Write(output[i] + ')');
                }
                else
                {
                    Console.Write(output[i]);
                }
            }
            Console.Read();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }
    public int CompareTo(PairVariable pv)
    {
        if (this.a > pv.a)
        {
            return 1;
        }
        else if (this.a < pv.a)
        {
            return -1;
        }
        else
        {
            if (this.b >= pv.b)
            {
                return 1;
            }
            else
            {
                return -1;
            }
        }
    }

}
namespace ConsoleApplication254
{
    class Program
    {
        static Dictionary<int, List<int>> d = new Dictionary<int, List<int>>();
        static int[] mark;
        static Dictionary<long, long> cnt;
        static int[] color;
        static int size = 0;
        static void dfs(int v)
        {
            size++;
            mark[v] = 1;
            bool w = false;
            if (cnt.ContainsKey(color[v]))
            {
                cnt[color[v]]++;
            }
            else
            {
                cnt.Add(color[v], 1);
            }
            for (int i = 0; i < d[v].Count; i++)
            {
                if (mark[d[v][i]] == 0)
                {

                    dfs(d[v][i]);
                }

            }

        }
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            int k1 = 0;
            int k2 = 0;
            int k3 = 0;
            if (n > 4)
            {
                string a1 = "+------------------------+";
                string a2 = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
                string a3 = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
                string a4 = "|O.......................|";
                string a5 = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
                string a6 = "+------------------------+";
                if ((n - 1) % 3 == 0)
                {
                    k1 = (n - 1) / 3;
                    k2 = (n - 1) / 3;
                    k3 = (n - 1) / 3;
                }
                else if ((n - 1) % 3 == 1)
                {
                    k1 = (n - 1) / 3 + 1;
                    k2 = (n - 1) / 3;
                    k3 = (n - 1) / 3;
                }
                else
                {
                    k1 = (n - 1) / 3 + 1;
                    k2 = (n - 1) / 3 + 1;
                    k3 = (n - 1) % 3;
                }
                //Console.WriteLine(k1+" "+k2+" "+k3);
                int k = 1;
                string c1 = a1;
                string c2 = "";
                string c3 = "";
                string c4 = a4;
                string c5 = "";
                string c6 = a6;
                for (int i = 0; i < a2.Length; i++)
                {
                    if (k <= k1)
                    {
                        if (a2[i] == '#')
                        {
                            c2 += 'O';
                            k++;
                        }
                        else
                        {
                            c2 += a2[i];
                        }
                    }
                    else
                    {
                        c2 += a2[i];
                    }
                }
                k = 1;
                for (int i = 0; i < a3.Length; i++)
                {
                    if (k <= k2)
                    {
                        if (a3[i] == '#')
                        {
                            c3 += 'O';
                            k++;
                        }
                        else
                        {
                            c3 += a3[i];
                        }
                    }
                    else
                    {
                        c3 += a3[i];
                    }
                }
                k = 1;
                for (int i = 0; i < a5.Length; i++)
                {
                    if (k <= k3)
                    {
                        if (a5[i] == '#')
                        {
                            c5 += 'O';
                            k++;
                        }
                        else
                        {
                            c5 += a5[i];
                        }
                    }
                    else
                    {
                        c5 += a5[i];
                    }
                }
                Console.WriteLine(c1);
                Console.WriteLine(c2);
                Console.WriteLine(c3);
                Console.WriteLine(c4);
                Console.WriteLine(c5);
                Console.WriteLine(c6);
            }
            else
            {

                if (n == 1)
                {
                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|#.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else if (n == 2)
                {

                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|#.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else if (n == 3)
                {
                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|O.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else if (n == 4)
                {
                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|O.......................|");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else
                {

                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|#.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }
    public int CompareTo(PairVariable pv)
    {
        if (this.a > pv.a)
        {
            return 1;
        }
        else if (this.a < pv.a)
        {
            return -1;
        }
        else
        {
            if (this.b >= pv.b)
            {
                return 1;
            }
            else
            {
                return -1;
            }
        }
    }

}
namespace ConsoleApplication254
{
    class Program
    {
        static Dictionary<int, List<int>> d = new Dictionary<int, List<int>>();
        static int[] mark;
        static Dictionary<long, long> cnt;
        static int[] color;
        static int size = 0;
        static void dfs(int v)
        {
            size++;
            mark[v] = 1;
            bool w = false;
            if (cnt.ContainsKey(color[v]))
            {
                cnt[color[v]]++;
            }
            else
            {
                cnt.Add(color[v], 1);
            }
            for (int i = 0; i < d[v].Count; i++)
            {
                if (mark[d[v][i]] == 0)
                {

                    dfs(d[v][i]);
                }

            }

        }
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            int k1 = 0;
            int k2 = 0;
            int k3 = 0;
            if (n > 4)
            {
                string a1 = "+------------------------+";
                string a2 = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
                string a3 = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
                string a4 = "|O.......................|";
                string a5 = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
                string a6 = "+------------------------+";
                if ((n - 1) % 3 == 0)
                {
                    k1 = (n - 1) / 3;
                    k2 = (n - 1) / 3;
                    k3 = (n - 1) / 3;
                }
                else if ((n - 1) % 3 == 1)
                {
                    k1 = (n - 1) / 3 + 1;
                    k2 = (n - 1) / 3;
                    k3 = (n - 1) / 3;
                }
                else
                {
                    k1 = (n - 1) / 3 + 1;
                    k2 = (n - 1) / 3 + 1;
                    k3 = (n - 1) % 3;
                }
                //Console.WriteLine(k1+" "+k2+" "+k3);
                int k = 1;
                string c1 = a1;
                string c2 = "";
                string c3 = "";
                string c4 = a4;
                string c5 = "";
                string c6 = a6;
                for (int i = 0; i < a2.Length; i++)
                {
                    if (k <= k1)
                    {
                        if (a2[i] == '#')
                        {
                            c2 += 'O';
                            k++;
                        }
                        else
                        {
                            c2 += a2[i];
                        }
                    }
                    else
                    {
                        c2 += a2[i];
                    }
                }
                k = 1;
                for (int i = 0; i < a3.Length; i++)
                {
                    if (k <= k2)
                    {
                        if (a3[i] == '#')
                        {
                            c3 += 'O';
                            k++;
                        }
                        else
                        {
                            c3 += a3[i];
                        }
                    }
                    else
                    {
                        c3 += a3[i];
                    }
                }
                k = 1;
                for (int i = 0; i < a5.Length; i++)
                {
                    if (k <= k3)
                    {
                        if (a5[i] == '#')
                        {
                            c5 += 'O';
                            k++;
                        }
                        else
                        {
                            c5 += a5[i];
                        }
                    }
                    else
                    {
                        c5 += a5[i];
                    }
                }
                Console.WriteLine(c1);
                Console.WriteLine(c2);
                Console.WriteLine(c3);
                Console.WriteLine(c4);
                Console.WriteLine(c5);
                Console.WriteLine(c6);
            }
            else
            {

                if (n == 1)
                {
                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|#.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else if (n == 2)
                {

                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|#.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else if (n == 3)
                {
                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|O.......................|");
                    Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
                else
                {
                    Console.WriteLine("+------------------------+");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|");
                    Console.WriteLine("|O.......................|");
                    Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|)");
                    Console.WriteLine("+------------------------+");
                }
            }
        }
    }
}

/*
 * Created by SharpDevelop.
 * Handle: Arcos
 */
using System;
using System.Collections;
using System.ComponentModel;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;

namespace TestingStuff
{
	class Program
	{
		public static void Main(string[] args)
		{
			var v = int.Parse(Console.ReadLine());
			var a = "";
			var b = "";
			var c = "";
			var d = "";
			if (v > 3){
				c = "O.";
				v--;
			} else {
				c = "#.";
			}
			int j = v / 3;
			doStuff(ref a,ref j,v);
			doStuff(ref b,ref j,v);
			doStuff(ref d,ref j,v);
			j = v - j * 3;
			doStuff2(ref a,ref j, v);
			doStuff2(ref b,ref j, v);
			doStuff2(ref d,ref j, v);
			Console.WriteLine("+------------------------+");
			Console.WriteLine("|"+a+"|D|)");
			Console.WriteLine("|"+b+"|.|");
			Console.WriteLine("|"+c+"......................|");
			Console.WriteLine("|"+d+"|.|)");
			Console.WriteLine("+------------------------+");
//			Console.ReadLine();
			return;
		}

		public static void doStuff(ref string a, ref int j, int v){
			for (int i = 0; i < j; i++){
				a += "O.";
			}
		}

		public static void doStuff2(ref string a, ref int j, int v){
			if (j > 0){
				a += "O.";
				j--;
			}
			while (a.Length < 22){
				a += "#.";
			}
		}

		public static void print(string a){
			Console.WriteLine(a);
		}
	}
}

// Remember these:
// String.Format("{0:0}",f).ToString();
// Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
// var splstr = Console.ReadLine().Split(' ').ToList();
// var str = Console.ReadLine();
// var l = new List<int>();

/*
 * Created by SharpDevelop.
 * Handle: Arcos
 */
using System;
using System.Collections;
using System.ComponentModel;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;

namespace TestingStuff
{
	class Program
	{
		public static void Main(string[] args)
		{
			var v = int.Parse(Console.ReadLine());
			var a = "";
			var b = "";
			var c = "";
			var d = "";
			if (v > 3){
				c = "O.";
				v--;
			}
			int j = v / 3;
			doStuff(ref a,ref j,v);
			doStuff(ref b,ref j,v);
			doStuff(ref d,ref j,v);
			j = v - j * 3;
			doStuff2(ref a,ref j, v);
			doStuff2(ref b,ref j, v);
			doStuff2(ref d,ref j, v);
			Console.WriteLine("+------------------------+");
			Console.WriteLine("|"+a+"|D|)");
			Console.WriteLine("|"+b+"|.|");
			Console.WriteLine("|"+c+"......................|");
			Console.WriteLine("|"+d+"|.|)");
			Console.WriteLine("+------------------------+");
//			Console.ReadLine();
			return;
		}

		public static void doStuff(ref string a, ref int j, int v){
			for (int i = 0; i < j; i++){
				a += "O.";
			}
		}

		public static void doStuff2(ref string a, ref int j, int v){
			if (j > 0){
				a += "O.";
				j--;
			}
			while (a.Length < 22){
				a += "#.";
			}
		}

		public static void print(string a){
			Console.WriteLine(a);
		}
	}
}

// Remember these:
// String.Format("{0:0}",f).ToString();
// Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
// var splstr = Console.ReadLine().Split(' ').ToList();
// var str = Console.ReadLine();
// var l = new List<int>();

/*
 * Created by SharpDevelop.
 * Handle: Arcos
 */
using System;
using System.Collections;
using System.ComponentModel;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;

namespace TestingStuff
{
	class Program
	{
		public static void Main(string[] args)
		{
			var v = int.Parse(Console.ReadLine());
			var a = "";
			var b = "";
			var c = "";
			var d = "";
			if (v > 3){
				c = "O.";
				v--;
			}
			int j = v / 3;
			doStuff(ref a,ref j,v);
			doStuff(ref b,ref j,v);
			doStuff(ref d,ref j,v);
			Console.WriteLine("Mid " + v + " " + j);
			j = v - j * 3;
			Console.WriteLine("Mid " + v + " " + j);
			doStuff2(ref a,ref j, v);
			doStuff2(ref b,ref j, v);
			doStuff2(ref d,ref j, v);
			Console.WriteLine("+------------------------+");
			Console.WriteLine("|"+a+"|D|)");
			Console.WriteLine("|"+b+"|.|");
			Console.WriteLine("|"+c+"......................|");
			Console.WriteLine("|"+d+"|.|)");
			Console.WriteLine("+------------------------+");
//			Console.ReadLine();
			return;
		}

		public static void doStuff(ref string a, ref int j, int v){
			for (int i = 0; i < j; i++){
				a += "O.";
			}
			print(a + " " + j);
		}

		public static void doStuff2(ref string a, ref int j, int v){
			if (j > 0){
				a += "O.";
				j--;
			}
			while (a.Length < 22){
				a += "#.";
			}
			print(a + " " + j);
		}

		public static void print(string a){
			Console.WriteLine(a);
		}
	}
}

// Remember these:
// String.Format("{0:0}",f).ToString();
// Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
// var splstr = Console.ReadLine().Split(' ').ToList();
// var str = Console.ReadLine();
// var l = new List<int>();

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CF475A {
    class Program {
        static void Main(string[] args) {
            int passengers = int.Parse(Console.ReadLine());

            Console.WriteLine("+------------------------+");
            for(int row = 0; row < 4; row++) {
                string r = "|";
                int seats = (passengers - 4) / 3;
                if(row == 0) {
                    if((passengers - 4) % 3 > 0) {
                        seats += 1;
                    }
                } else if(row == 1) {
                    if((passengers - 4) % 3 > 1) {
                        seats += 1;
                    }
                }
                if(row == 2) {
                    if(passengers >= 3) {
                        Console.WriteLine("|O.......................|");
                    } else {
                        Console.WriteLine("|#.......................|");
                    }
                    continue;
                }

                for(int i = 0; i <= seats; i++) {
                    r += "O.";
                }
                for(int i = seats; i < 10; i++) {
                    r += "#.";
                }
                if(row == 0) {
                    r += "|D|)";
                } else if(row == 1) {
                    r += "|.|";
                } else if(row == 2) {
                    r += "..|";
                } else if (row == 3) {
                    r += "|.|)";
                }
                Console.WriteLine(r);
            }
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CF475A {
    class Program {
        static void Main(string[] args) {
            int passengers = int.Parse(Console.ReadLine());

            Console.WriteLine("+------------------------+");
            for(int row = 0; row < 4; row++) {
                string r = "|";
                int seats = (passengers - 4) / 3;
                if(row == 0) {
                    if((passengers - 4) % 3 > 0) {
                        seats += 1;
                    }
                } else if(row == 1) {
                    if((passengers - 4) % 3 > 1) {
                        seats += 1;
                    }
                }
                if(row == 2) {
                    if(passengers >= 3) {
                        Console.WriteLine("|O.......................|");
                    } else {
                        Console.WriteLine("|#.......................|");
                    }
                    continue;
                }

                for(int i = 0; i <= seats; i++) {
                    if(row == 3 && passengers < 4) {
                        continue;
                    }
                    r += "O.";
                }
                if(passengers - (row + 1) == 0 && row == 0) {
                    r += "O.";
                    seats++;
                }
                for(int i = seats; i < 10; i++) {
                    r += "#.";

                }
                if(row == 0) {
                    r += "|D|)";
                } else if(row == 1) {
                    r += "|.|";
                } else if(row == 2) {
                    r += "..|";
                } else if (row == 3) {
                    r += "|.|)";
                }
                Console.WriteLine(r);
            }
            Console.WriteLine("+------------------------+");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CF475A {
    class Program {
        static void Main(string[] args) {
            int passengers = int.Parse(Console.ReadLine());

            Console.WriteLine("+------------------------+");
            for(int row = 0; row < 4; row++) {
                string r = "|";
                int seats = (passengers - 4) / 3;
                if(row == 0) {
                    if((passengers - 4) % 3 > 0) {
                        seats += 1;
                    }
                } else if(row == 1) {
                    if((passengers - 4) % 3 > 1) {
                        seats += 1;
                    }
                }
                if(row == 2) {
                    if(passengers >= 3) {
                        Console.WriteLine("|O.......................|");
                    } else {
                        Console.WriteLine("|#.......................|");
                    }
                    continue;
                }

                for(int i = 0; i <= seats; i++) {
                    r += "O.";
                }
                for(int i = seats; i < 11; i++) {
                    r += "#.";
                }
                if(row == 0) {
                    r += "|D|)";
                } else if(row == 1) {
                    r += "|.|";
                } else if(row == 2) {
                    r += "..|";
                } else if (row == 3) {
                    r += "|.|)";
                }
                Console.WriteLine(r);
            }
            Console.WriteLine("+------------------------+");
        }
    }
}