#include <bits/stdc++.h>
using namespace std;
const double EPS = (1e-11);
const double PI = acos(-1.0);
const int INF = 9999999;
const int MOD = (1e9 + 7);
int main(void) {
  char foo[6][100];
  memset(foo, '\0', sizeof foo);
  foo[0][0] = foo[0][25] = foo[5][0] = foo[5][25] = '+';
  for (int i = 1; i <= 24; i++) foo[0][i] = foo[5][i] = '-';
  for (int i = 1; i <= 4; i++) foo[i][0] = foo[i][25] = '|';
  bool togg = 1;
  for (int i = 1; i <= 4; i++)
    for (int j = 1; j <= 22; j++) {
      if (i == 3)
        foo[i][j] = '.';
      else if (togg)
        foo[i][j] = '#', togg = 0;
      else
        foo[i][j] = '.', togg = 1;
    }
  for (int i = 1; i <= 4; i++)
    if (i == 3)
      foo[i][23] = '.';
    else
      foo[i][23] = '|';
  foo[1][24] = 'D';
  for (int i = 2; i <= 4; i++) foo[i][24] = '.';
  foo[1][26] = foo[4][26] = ')';
  foo[3][1] = '#';
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= 4; i++) {
    if (!N) break;
    foo[i][1] = 'O';
    N--;
  }
  int A = N / 3;
  int B = N % 3;
  togg = 1;
  for (int i = 1; i <= 4; i++) {
    togg = 1;
    for (int j = 3; j <= A * 2 + 1; j++) {
      if (i == 3) continue;
      if (togg)
        foo[i][j] = 'O', togg = 0;
      else
        foo[i][j] = '.', togg = 1;
    }
  }
  for (int i = 1; i <= B; i++) foo[i][A * 2 + 3] = 'O';
  for (int i = 0; i < 6; i++) puts(foo[i]);
  return (0);
}
