#include <bits/stdc++.h>
using namespace std;
int N;
int seat[12][5];
int main() {
  scanf("%d", &N);
  puts("+------------------------+");
  for (int i = 0; i < 11; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (i == 0 && N > 0) {
        seat[i][j] = 1;
        N--;
      } else if (0 < i && j != 2 && N > 0) {
        seat[i][j] = 1;
        N--;
      } else if (i > 0 && j == 2)
        seat[i][j] = -1;
    }
  }
  for (int i = 0; i < 4; ++i) {
    printf("|");
    for (int j = 0; j < 11; ++j) {
      if (seat[j][i] == 1)
        printf("O.");
      else if (seat[j][i] == -1)
        printf("..");
      else if (seat[j][i] == 0)
        printf("#.");
    }
    if (i == 0)
      puts("|D|)");
    else if (i == 1)
      puts("|.|");
    else if (i == 2)
      puts("..|");
    else if (i == 3)
      puts("|.|)");
  }
  puts("+------------------------+");
  return 0;
}
