#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  cout << "+------------------------+" << endl;
  string x[4], e;
  x[0] = "#.#.#.#.#.#.#.#.#.#.#.";
  x[1] = "#.#.#.#.#.#.#.#.#.#.#.";
  x[2] = "#.....................";
  x[3] = "#.#.#.#.#.#.#.#.#.#.#.";
  for (int i = 0; i < x[0].length(); i++) {
    for (int j = 0; j < 4; j++) {
      if (k == 0) break;
      if (x[j][i] == '#') {
        k--;
        x[j][i] = 'O';
      }
    }
    if (k == 0) break;
  }
  cout << "|" << x[0] << "|D|)" << endl;
  cout << "|" << x[1] << "|.|" << endl;
  cout << "|" << x[2] << "..|" << endl;
  cout << "|" << x[3] << "|.|)" << endl;
  cout << "+------------------------+";
  return 0;
}
