#include <bits/stdc++.h>
using namespace std;
int n, i;
int fi = 0, se = 0, th = 0, fo = 0;
int main() {
  cin >> n;
  cout << "+------------------------+" << endl;
  if (n >= 3) {
    n--;
    th++;
  }
  while (n) {
    if (n) {
      fi++;
      n--;
    }
    if (n) {
      se++;
      n--;
    }
    if (n) {
      fo++;
      n--;
    }
  }
  cout << "|";
  for (i = 11; i; i--) {
    if (fi) {
      cout << "O.";
      fi--;
    } else {
      cout << "#.";
    }
  }
  cout << "|D|)" << endl;
  cout << "|";
  for (i = 11; i; i--) {
    if (se) {
      cout << "O.";
      se--;
    } else {
      cout << "#.";
    }
  }
  cout << "|.|" << endl;
  cout << "|";
  if (th) {
    cout << "O";
  } else {
    cout << "#";
  }
  cout << ".......................|" << endl;
  cout << "|";
  for (i = 11; i; i--) {
    if (fo) {
      cout << "O.";
      fo--;
    } else {
      cout << "#.";
    }
  }
  cout << "|.|)" << endl;
  cout << "+------------------------+" << endl;
  return 0;
}
