#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, r;
  cin >> n;
  string r1, r2, r3, r4;
  cout << "+------------------------+" << endl;
  r1.push_back('|');
  r2.push_back('|');
  r3.push_back('|');
  r4.push_back('|');
  if (n >= 3) {
    r3.push_back('O');
    r3.push_back('.');
    n--;
  } else {
    r3.push_back('#');
    r3.push_back('.');
  }
  for (i = 0; i < 11; i++) {
    if (n) {
      r1.push_back('O');
      r1.push_back('.');
      n--;
    } else {
      r1.push_back('#');
      r1.push_back('.');
    }
    if (n) {
      r2.push_back('O');
      r2.push_back('.');
      n--;
    } else {
      r2.push_back('#');
      r2.push_back('.');
    }
    if (n) {
      r4.push_back('O');
      r4.push_back('.');
      n--;
    } else {
      r4.push_back('#');
      r4.push_back('.');
    }
    if (i) {
      r3.push_back('.');
      r3.push_back('.');
    }
  }
  r1.push_back('|');
  r1.push_back('D');
  r1.push_back('|');
  r1.push_back(')');
  r2.push_back('|');
  r2.push_back('.');
  r2.push_back('|');
  r3.push_back('.');
  r3.push_back('.');
  r3.push_back('|');
  r4.push_back('|');
  r4.push_back('.');
  r4.push_back('|');
  r4.push_back(')');
  cout << r1 << endl;
  cout << r2 << endl;
  cout << r3 << endl;
  cout << r4 << endl;
  cout << "+------------------------+" << endl;
  return 0;
}
