#include <bits/stdc++.h>
using namespace std;
int MIN(int a, int b) { return (a < b) ? a : b; }
int MAX(int a, int b) { return (a < b) ? b : a; }
string toStr(int n) {
  string s;
  ostringstream buffer;
  buffer << n;
  s = buffer.str();
  return s;
}
int toInt(string str) {
  int n;
  istringstream buffer(str);
  buffer >> n;
  return n;
}
long long pot(long long a, long long b) {
  if (!b) return 1;
  if (b & 1)
    return a * pot(a * a, b >> 1);
  else
    return pot(a * a, b >> 1);
}
int main() {
  int k;
  cin >> k;
  vector<string> v;
  string seat = "";
  int fullRow = 0;
  int semiRow = 0;
  if (k > 4) {
    seat = "OOOO";
    k -= 4;
    fullRow = k / 3;
    semiRow = k % 3;
  } else {
    for (int i = 0; i < k; ++i) seat += "O";
    for (int i = k; i < 4; ++i) seat += "#";
  }
  v.push_back(seat);
  for (int i = 0; i < fullRow; ++i) {
    v.push_back("OO.O");
  }
  if (semiRow == 1)
    v.push_back("O#.#");
  else if (semiRow == 2)
    v.push_back("OO.#");
  else if (semiRow == 3)
    v.push_back("OO.O");
  int empty = 10 - fullRow;
  if (semiRow > 0) empty--;
  for (int i = 0; i < empty; ++i) v.push_back("##.#");
  cout << "+------------------------+" << endl;
  for (int j = 0; j < 4; ++j) {
    cout << "|";
    for (int i = 0; i < v.size(); ++i) {
      cout << v[i][j] << ".";
    }
    if (j != 2)
      cout << "|";
    else
      cout << ".";
    if (j == 0)
      cout << "D";
    else
      cout << ".";
    cout << "|";
    if (j == 0 || j == 3) cout << ")";
    cout << endl;
  }
  cout << "+------------------------+" << endl;
  return 0;
}
