#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
inline int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
char c[7][28] = {"+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
                 "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
                 "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
int main() {
  int x;
  scanf("%d", &x);
  for (int i = 0; i < 27; ++i) {
    for (int j = 0; j < 6; ++j) {
      if (c[j][i] == '#') {
        c[j][i] = 'O';
        --x;
        if (!x) break;
      }
    }
    if (!x) break;
  }
  for (int i = 0; i < 6; ++i) {
    for (int j = 0; j < 27; ++j) {
      if ((i == 0 || i == 2 || i == 3 || i == 5) && j == 26) continue;
      cout << c[i][j];
    }
    cout << endl;
  }
  return 0;
}
