#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t = 0;
  string sandali[6];
  sandali[0] = "+------------------------+";
  sandali[1] = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
  sandali[2] = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
  sandali[3] = "|#.......................|";
  sandali[4] = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
  sandali[5] = "+------------------------+";
  while (cin >> n) {
    for (int i = 1; i < 23; i++) {
      for (int j = 1; j < 5; j++) {
        if (sandali[j][i] == '#' && n > 0) {
          sandali[j][i] = 'O';
          n--;
        }
      }
    }
    while (t < 6) {
      cout << sandali[t] << endl;
      t++;
    }
  }
  return 0;
}
