#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, c = 0;
  n = 4;
  m = 14;
  string arr[n][m];
  cin >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (j == 0)
        arr[i][j] = "|#";
      else {
        if (j == m - 3 && i == 0 || j == m - 3 && i == 1 ||
            j == m - 3 && i == 3)
          arr[i][j] = ".|";
        else if (j == m - 3 && i == 2)
          arr[i][j] = "..";
        else if (j == m - 2 && i == 0)
          arr[i][j] = "D|";
        else if (j == m - 2 && i == 1 || j == m - 2 && i == 3 ||
                 j == m - 2 && i == 2)
          arr[i][j] = ".|";
        else if (j == m - 1 && i == 0 || j == m - 1 && i == 3)
          arr[i][j] = ")";
        else if (j == m - 1 && i == 1 || j == m - 1 && i == 2)
          continue;
        else if (i == 2 && j != 0 || i == 2 && j != m - 2 ||
                 i == 2 && j != m - 1)
          arr[i][j] = "..";
        else
          arr[i][j] = ".#";
      }
    }
  }
  while (k) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (j == c) {
          if (arr[i][j] == "|#" && k != 0) {
            arr[i][j] = "|O";
            k--;
          } else if (arr[i][j] == ".#" && k != 0) {
            arr[i][j] = ".O";
            k--;
          }
        }
      }
    }
    c++;
  }
  for (int i = 0; i < m; i++) {
    if (i == 0)
      cout << "+";
    else if (i == m - 1)
      cout << "+";
    else
      cout << "--";
  }
  cout << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << arr[i][j];
    }
    cout << endl;
  }
  for (int i = 0; i < m; i++) {
    if (i == 0)
      cout << "+";
    else if (i == m - 1)
      cout << "+";
    else
      cout << "--";
  }
  cout << endl;
  return 0;
}
