#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  cout << "+------------------------+" << endl;
  vector<vector<bool> > v(4, vector<bool>(22));
  int cont = 0;
  for (int j = 0; j < 22; j++) {
    for (int i = 0; i < 4; i++) {
      if (j % 2 == 1) continue;
      if (j > 1 && i == 2) continue;
      if (cont < n) {
        v[i][j] = true;
        ++cont;
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << "|";
    for (int j = 0; j < 22; j++) {
      if (v[i][j])
        cout << 'O';
      else if (j % 2 == 1)
        cout << '.';
      else if (j > 1 && i == 2)
        cout << '.';
      else
        cout << '#';
    }
    if (i == 0) cout << "|D|)" << endl;
    if (i == 1) cout << "|.|" << endl;
    if (i == 2) cout << "..|" << endl;
    if (i == 3) cout << "|.|)" << endl;
  }
  cout << "+------------------------+" << endl;
}
