#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, d, e, f, g;
  cin >> a;
  if (a == 0)
    cout << "+------------------------+\n|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#."
            "#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 1)
    cout << "+------------------------+\n|O.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#."
            "#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 2)
    cout << "+------------------------+\n|O.#.#.#.#.#.#.#.#.#.#.|D|)\n|O.#.#.#."
            "#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 3)
    cout << "+------------------------+\n|O.#.#.#.#.#.#.#.#.#.#.|D|)\n|O.#.#.#."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|#.#.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 4)
    cout << "+------------------------+\n|O.#.#.#.#.#.#.#.#.#.#.|D|)\n|O.#.#.#."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.#.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 5)
    cout << "+------------------------+\n|O.O.#.#.#.#.#.#.#.#.#.|D|)\n|O.#.#.#."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.#.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 6)
    cout << "+------------------------+\n|O.O.#.#.#.#.#.#.#.#.#.|D|)\n|O.O.#.#."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.#.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 7)
    cout << "+------------------------+\n|O.O.#.#.#.#.#.#.#.#.#.|D|)\n|O.O.#.#."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 8)
    cout << "+------------------------+\n|O.O.O.#.#.#.#.#.#.#.#.|D|)\n|O.O.#.#."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 9)
    cout << "+------------------------+\n|O.O.O.#.#.#.#.#.#.#.#.|D|)\n|O.O.O.#."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.#.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 10)
    cout << "+------------------------+\n|O.O.O.#.#.#.#.#.#.#.#.|D|)\n|O.O.O.#."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 11)
    cout << "+------------------------+\n|O.O.O.O.#.#.#.#.#.#.#.|D|)\n|O.O.O.#."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 12)
    cout << "+------------------------+\n|O.O.O.O.#.#.#.#.#.#.#.|D|)\n|O.O.O.O."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.#.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 13)
    cout << "+------------------------+\n|O.O.O.O.#.#.#.#.#.#.#.|D|)\n|O.O.O.O."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 14)
    cout << "+------------------------+\n|O.O.O.O.O.#.#.#.#.#.#.|D|)\n|O.O.O.O."
            "#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 15)
    cout << "+------------------------+\n|O.O.O.O.O.#.#.#.#.#.#.|D|)\n|O.O.O.O."
            "O.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.#.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 16)
    cout << "+------------------------+\n|O.O.O.O.O.#.#.#.#.#.#.|D|)\n|O.O.O.O."
            "O.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 17)
    cout << "+------------------------+\n|O.O.O.O.O.O.#.#.#.#.#.|D|)\n|O.O.O.O."
            "O.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 18)
    cout << "+------------------------+\n|O.O.O.O.O.O.#.#.#.#.#.|D|)\n|O.O.O.O."
            "O.O.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.#.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 19)
    cout << "+------------------------+\n|O.O.O.O.O.O.#.#.#.#.#.|D|)\n|O.O.O.O."
            "O.O.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 20)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.#.#.#.#.|D|)\n|O.O.O.O."
            "O.O.#.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 21)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.#.#.#.#.|D|)\n|O.O.O.O."
            "O.O.O.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.#.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 22)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.#.#.#.#.|D|)\n|O.O.O.O."
            "O.O.O.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 23)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.#.#.#.|D|)\n|O.O.O.O."
            "O.O.O.#.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 24)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.#.#.#.|D|)\n|O.O.O.O."
            "O.O.O.O.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.#.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 25)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.#.#.#.|D|)\n|O.O.O.O."
            "O.O.O.O.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 26)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.O.#.#.|D|)\n|O.O.O.O."
            "O.O.O.O.#.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 27)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.O.#.#.|D|)\n|O.O.O.O."
            "O.O.O.O.O.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.#."
            "#.#.|.|)\n+------------------------+";
  else if (a == 28)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.O.#.#.|D|)\n|O.O.O.O."
            "O.O.O.O.O.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.O."
            "#.#.|.|)\n+------------------------+";
  else if (a == 29)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.O.O.#.|D|)\n|O.O.O.O."
            "O.O.O.O.O.#.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.O."
            "#.#.|.|)\n+------------------------+";
  else if (a == 30)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.O.O.#.|D|)\n|O.O.O.O."
            "O.O.O.O.O.O.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.O."
            "#.#.|.|)\n+------------------------+";
  else if (a == 31)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.O.O.#.|D|)\n|O.O.O.O."
            "O.O.O.O.O.O.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.O."
            "O.#.|.|)\n+------------------------+";
  else if (a == 32)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.O.O.O.|D|)\n|O.O.O.O."
            "O.O.O.O.O.O.#.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.O."
            "O.#.|.|)\n+------------------------+";
  else if (a == 33)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.O.O.O.|D|)\n|O.O.O.O."
            "O.O.O.O.O.O.O.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.O."
            "O.#.|.|)\n+------------------------+";
  else if (a == 34)
    cout << "+------------------------+\n|O.O.O.O.O.O.O.O.O.O.O.|D|)\n|O.O.O.O."
            "O.O.O.O.O.O.O.|.|\n|O.......................|\n|O.O.O.O.O.O.O.O.O."
            "O.O.|.|)\n+------------------------+";
  return 0;
}
