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