#include <bits/stdc++.h>
using namespace std;
int compare(const void *a1, const void *a2) {
  if ((*((int *)a1)) < (*((int *)a2)))
    return -1;
  else if ((*((int *)a1)) > (*((int *)a2)))
    return 1;
  else
    return 0;
}
int max(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}
int main() {
  int k;
  cin >> k;
  cout << "+------------------------+" << endl;
  int answ1[4];
  int answ2[10][3];
  for (int i = 0; i < 4; i++) {
    answ1[i] = 0;
  }
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 3; j++) {
      answ2[i][j] = 0;
    }
  }
  for (int i = 0; (i < 4) && (k > 0); i++) {
    answ1[i] = 1;
    k--;
  }
  for (int i = 0; (i < 10) && (k > 0); i++) {
    for (int j = 0; (j < 3) && (k > 0); j++) {
      answ2[i][j] = 1;
      k--;
    }
  }
  cout << '|';
  if (answ1[0] == 0)
    cout << "#.";
  else
    cout << "O.";
  for (int i = 0; i < 10; i++) {
    if (answ2[i][0] == 0)
      cout << "#.";
    else
      cout << "O.";
  }
  cout << "|D|)" << endl;
  cout << '|';
  if (answ1[1] == 0)
    cout << "#.";
  else
    cout << "O.";
  for (int i = 0; i < 10; i++) {
    if (answ2[i][1] == 0)
      cout << "#.";
    else
      cout << "O.";
  }
  cout << "|.|" << endl;
  cout << '|';
  if (answ1[2] == 0)
    cout << "#.";
  else
    cout << "O.";
  cout << "......................|" << endl;
  cout << '|';
  if (answ1[3] == 0)
    cout << "#.";
  else
    cout << "O.";
  for (int i = 0; i < 10; i++) {
    if (answ2[i][2] == 0)
      cout << "#.";
    else
      cout << "O.";
  }
  cout << "|.|)" << endl;
  cout << "+------------------------+" << endl;
  return 0;
}
