#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  cout << '+';
  for (int i = 0; i < 24; i++) cout << '-';
  cout << "+\n";
  int r1 = (k + 1) / 3;
  bool enough = 0;
  int passenegrs = 0;
  for (int i = 0; i < 27; i++) {
    if (i == 0 || i == 23 || i == 25)
      cout << '|';
    else if (i == 24)
      cout << 'D';
    else if (i == 26)
      cout << ')';
    else if (i % 2 == 0)
      cout << '.';
    else {
      if (passenegrs < r1 || k == 1 && !enough)
        cout << 'O', passenegrs++;
      else
        cout << '#';
      if (k == 1 || passenegrs == r1) enough = 1;
    }
  }
  cout << endl;
  int r2 = k / 3;
  bool enough1 = 0;
  int passenegrs1 = 0;
  for (int i = 0; i < 26; i++) {
    if (i == 0 || i == 23 || i == 25)
      cout << '|';
    else if (i % 2 == 0)
      cout << '.';
    else {
      if ((passenegrs1 < r2 || k == 2) && !enough1)
        cout << 'O', passenegrs1++;
      else
        cout << '#';
      if (k == 2 || passenegrs1 == r2) enough1 = 1;
    }
  }
  cout << endl;
  bool r3 = 1;
  for (int i = 0; i < 26; i++) {
    if (i == 0 || i == 25)
      cout << '|';
    else if (i % 2 == 0)
      cout << '.';
    else {
      if (k > 2 && r3)
        cout << 'O', r3 = 0;
      else if (i == 1)
        cout << '#';
      else
        cout << '.';
    }
  }
  cout << endl;
  int r4 = (k - 1) / 3;
  bool enough3 = 0;
  int passenegrs3 = 0;
  for (int i = 0; i < 27; i++) {
    if (i == 0 || i == 23 || i == 25)
      cout << '|';
    else if (i == 26)
      cout << ')';
    else if (i % 2 == 0)
      cout << '.';
    else {
      if (passenegrs3 < r4 || k == 4 && !enough3)
        cout << 'O', passenegrs3++;
      else
        cout << '#';
      if (k == 4 || passenegrs3 == r4) enough3 = 1;
    }
  }
  cout << endl;
  cout << '+';
  for (int i = 0; i < 24; i++) cout << '-';
  cout << "+";
  return 0;
}
