#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  switch (k) {
    case 0:
      cout << "+------------------------+" << endl;
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|#.......................|" << endl;
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 1:
      cout << "+------------------------+" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|#.......................|" << endl;
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 2:
      cout << "+------------------------+" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|#.......................|" << endl;
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 3:
      cout << "+------------------------+" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 4:
      cout << "+------------------------+" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 5:
      cout << "+------------------------+" << endl;
      cout << "|O.O.#.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 6:
      cout << "+------------------------+" << endl;
      cout << "|O.O.#.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.#.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 7:
      cout << "+------------------------+" << endl;
      cout << "|O.O.#.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.#.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 8:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.#.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 9:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.#.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 10:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.#.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 11:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.#.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 12:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.#.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 13:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.#.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 14:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.#.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 15:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.#.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 16:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.#.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 17:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.#.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 18:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.#.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 19:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.#.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 20:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.#.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 21:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.#.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 22:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.#.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 23:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.#.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 24:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.#.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 25:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.#.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 26:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.#.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 27:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.#.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 28:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.#.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 29:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.#.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 30:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.#.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 31:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.#.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 32:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.O.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.#.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 33:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.O.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.O.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.#.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
    case 34:
      cout << "+------------------------+" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.O.|D|)" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.O.|.|" << endl;
      cout << "|O.......................|" << endl;
      cout << "|O.O.O.O.O.O.O.O.O.O.O.|.|)" << endl;
      cout << "+------------------------+" << endl;
      break;
  }
  return 0;
}
