#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  int p[4][11] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                  {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
                  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
  for (int i(0); i < 11; i++) {
    for (int j(0); j < 4; j++) {
      if (k == 0) {
        break;
      }
      if (p[j][i] == 0) {
        p[j][i] = 1;
        k--;
      }
    }
  }
  cout << "+------------------------+" << endl;
  cout << "|";
  for (int i(0); i < 4; i++) {
    for (int j(0); j < 11; j++) {
      if (i != 2) {
        if (p[i][j] == 1) {
          cout << "O.";
        } else
          cout << "#.";
      } else {
        if (p[i][0] == 1) {
          cout << "O.";
        } else
          cout << "#.";
        cout << "......................|";
        break;
      }
    }
    if (i == 0) {
      cout << "|D|)";
    }
    if (i == 1) {
      cout << "|.|";
    }
    if (i == 3) {
      cout << "|.|)";
    }
    cout << endl;
    if (i != 3) {
      cout << "|";
    }
  }
  cout << "+------------------------+" << endl;
  return 0;
}
