#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, list[4][11], pass, i, j;
  a = b = c = d = 0;
  for (i = 0; i < 4; ++i)
    for (j = 0; j < 11; ++j) {
      list[i][j] = 0;
    }
  cin >> pass;
  while (pass) {
    if (a < 11 && pass) {
      list[0][a++] = 1;
      pass--;
    }
    if (b < 11 && pass) {
      list[1][b++] = 1;
      pass--;
    }
    if (c < 1 && pass) {
      list[2][c++] = 1;
      pass--;
    }
    if (d < 11 && pass) {
      list[3][d++] = 1;
      pass--;
    }
  }
  cout << "+------------------------+\n|";
  for (i = 0; i < 4; ++i) {
    for (j = 0; j < 11; ++j)
      if (list[i][j])
        cout << "O.";
      else if (list[i][j] == 0 && i != 2)
        cout << "#.";
      else if (list[i][j] == 0 && i == 2 && j == 0)
        cout << "#.";
      else
        cout << "..";
    if (i == 0)
      cout << "|D|)\n|";
    else if (i == 1)
      cout << "|.|\n|";
    else if (i == 2)
      cout << "..|\n|";
    else if (i == 3)
      cout << "|.|)\n";
  }
  cout << "+------------------------+";
  return 0;
}
