#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  cout << "+------------------------+" << endl;
  vector<int> V[5];
  int i = 1;
  while (n--) {
    if (i == 3 && V[i].size() == 0)
      V[i].push_back(1);
    else {
      if (i == 3) i++;
      V[i].push_back(1);
      i++;
      if (i == 5) i = 1;
    }
  }
  for (int i = 1; i <= 4; i++) {
    int cnt = 0;
    cout << "|";
    for (int k = 0; k < V[i].size(); k++) {
      cout << "O.";
      cnt++;
    }
    bool ff = 0;
    for (int l = cnt; l < 11; l++) {
      if (i != 3)
        cout << "#.";
      else if (i == 3 && cnt == 0 && ff == 0) {
        cout << "#.";
        ff = 1;
      } else
        cout << "..";
    }
    if (i == 1)
      cout << "|D|)" << endl;
    else if (i == 4) {
      cout << "|.|)" << endl;
    } else if (i == 3) {
      cout << "..|" << endl;
    } else if (i == 2) {
      cout << "|.|" << endl;
    }
  }
  cout << "+------------------------+" << endl;
  return 0;
}
