#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-11;
int n;
int last[4];
int mid[10][3];
int main() {
  cin >> n;
  for (int i = 0; i < (n); i++) {
    bool good = 0;
    for (int j = 0; j < (4); j++)
      if (last[j] == 0) {
        last[j] = 1;
        good = 1;
        break;
      }
    if (good) continue;
    for (int j = 0; j < (10); j++) {
      bool good = 0;
      for (int k = 0; k < (3); k++)
        if (mid[j][k] == 0) {
          mid[j][k] = 1;
          good = 1;
          break;
        }
      if (good) break;
    }
  }
  cout << "+------------------------+\n";
  for (int i = 0; i < (4); i++) {
    cout << "|";
    if (last[i])
      cout << 'O';
    else
      cout << '#';
    cout << '.';
    if (i < 2) {
      for (int j = 0; j < (10); j++) {
        if (mid[j][i])
          cout << 'O';
        else
          cout << '#';
        cout << '.';
      }
    }
    if (i == 2) {
      for (int j = 0; j < (20); j++) cout << '.';
    }
    if (i == 3) {
      for (int j = 0; j < (10); j++) {
        if (mid[j][2])
          cout << 'O';
        else
          cout << '#';
        cout << '.';
      }
    }
    if (i == 2)
      cout << '.';
    else
      cout << '|';
    if (i == 0)
      cout << 'D';
    else
      cout << '.';
    cout << '|';
    if (i == 0 || i == 3) cout << ')';
    cout << '\n';
  }
  cout << "+------------------------+\n";
  return 0;
}
