#include <bits/stdc++.h>
using namespace std;
bool isUsed(int row, int col, int k) {
  if (row == 1 && col == 3) {
    cout << "";
  }
  int seat = (row - 1) * 3 + col;
  if (row != 1) {
    seat++;
  }
  if (col == 3 && seat <= k) {
    return row == 1;
  } else if (col == 4 && row > 1) {
    seat--;
  }
  return seat <= k;
}
int main() {
  int k;
  cin >> k;
  const int rows = 11;
  const int cols = 4;
  cout << "+";
  for (int i = 0; i < rows * 2 + 2; i++) {
    cout << "-";
  }
  cout << "+" << endl;
  for (int i = 0; i < cols; i++) {
    cout << "|";
    for (int j = 0; j < rows; j++) {
      if (isUsed(j + 1, i + 1, k)) {
        cout << "O";
      } else if (i == 2 && j > 0) {
        cout << ".";
      } else {
        cout << "#";
      }
      cout << ".";
    }
    if (i == 0) {
      cout << "|D|)";
    } else if (i == 1) {
      cout << "|.|";
    } else if (i == 2) {
      cout << "..|";
    } else if (i == 3) {
      cout << "|.|)";
    }
    cout << endl;
  }
  cout << "+";
  for (int i = 0; i < rows * 2 + 2; i++) {
    cout << "-";
  }
  cout << "+" << endl;
  return 0;
}
