The final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried around with a yellow bus. The bus has 34 passenger seats: 4 seats in the last row and 3 seats in remaining rows.  [Image] 

The event coordinator has a list of k participants who should be picked up at the airport. When a participant gets on the bus, he will sit in the last row with an empty seat. If there is more than one empty seat in that row, he will take the leftmost one. 

In order to keep track of the people who are on the bus, the event coordinator needs a figure showing which seats are going to be taken by k participants. Your task is to draw the figure representing occupied seats.


-----Input-----

The only line of input contains integer k, (0 ≤ k ≤ 34), denoting the number of participants.


-----Output-----

Print the figure of a bus with k passengers as described in sample tests. Character '#' denotes an empty seat, while 'O' denotes a taken seat. 'D' is the bus driver and other characters in the output are for the purpose of beautifying the figure. Strictly follow the sample test cases output format. Print exactly six lines. Do not output extra space or other characters.


-----Examples-----
Input
9

Output
+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Input
20

Output
+------------------------+
|O.O.O.O.O.O.O.#.#.#.#.|D|)
|O.O.O.O.O.O.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.#.#.#.#.#.|.|)
+------------------------+

Source: codeforces | Difficulty: EASY
Tags: Implementation


Solutions:
k = int(input())
output = ['+------------------------+', '|#.#.#.#.#.#.#.#.#.#.#.|D|)', '|#.#.#.#.#.#.#.#.#.#.#.|.|', '|#.......................|', '|#.#.#.#.#.#.#.#.#.#.#.|.|)', '+------------------------+']
ls = [1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4]
t = k
if k > 2:
	output[3] = output[3].replace('#', 'O', 1)
	t = k - 1
for l in ls[:t]:
	output[l] = output[l].replace('#', 'O', 1)
for line in output:
	print(line)


x = int(input())
y = x - 4
fila = []
if y >= 0:
	fila.append(1 + y // 3)
	fila.append(1 + y // 3)
	fila.append(1 + y // 3)
	if y % 3 == 2:
		fila[1] += 1
	if y % 3 >= 1:
		fila[0] += 1
else:
	if x >= 1:
		fila.append(1)
	else:
		fila.append(0)
	fila.append(x // 2)
	fila.append(0)
if x > 2:
	k = 'O.'
else:
	k = '#.'
print('+------------------------+')
print('|' + 'O.' * fila[0] + '#.' * (11 - fila[0]) + '|D|)')
print('|' + 'O.' * fila[1] + '#.' * (11 - fila[1]) + '|.|')
print('|' + k + '......................|')
print('|' + 'O.' * fila[2] + '#.' * (11 - fila[2]) + '|.|)')
print('+------------------------+')


n = int(input())
A = []
A.append(list('+------------------------+'))
A.append(list('|#.#.#.#.#.#.#.#.#.#.#.|D|)'))
A.append(list('|#.#.#.#.#.#.#.#.#.#.#.|.|'))
A.append(list('|#.......................|'))
A.append(list('|#.#.#.#.#.#.#.#.#.#.#.|.|)'))
A.append(list('+------------------------+'))
for k in range(n):
	j = i = 1
	while A[i][j] != '#':
		i = 1
		while i < 5 and A[i][j] != '#':
			i += 1
		if A[i][j] != '#':
			j += 2
	A[i][j] = 'O'
for line in A:
	print(''.join(line))


k = int(input())
seat_map = ['+------------------------+', '|#.#.#.#.#.#.#.#.#.#.#.|D|)', '|#.#.#.#.#.#.#.#.#.#.#.|.|', '|#.......................|', '|#.#.#.#.#.#.#.#.#.#.#.|.|)', '+------------------------+']
seat = list(map(list, seat_map))
for L in range(len(seat[0])):
	for W in range(len(seat)):
		if seat[W][L] == '#' and k > 0:
			seat[W][L] = 'O'
			k -= 1
for line in seat:
	print(''.join(line))


def main():
	n = int(input())
	print('+------------------------+')
	b1 = 0
	if n == 0:
		b1 = 0
	elif 1 <= n <= 4:
		b1 = 1
	else:
		b1 = (n + 1) // 3
	if 0 <= n <= 1:
		b2 = 0
	elif 2 <= n <= 5:
		b2 = 1
	else:
		b2 = n // 3
	b3 = 0
	if n < 3:
		b3 = 0
	else:
		b3 = 1
	b4 = 0
	if n <= 3:
		b4 = 0
	else:
		b4 = (n - 1) // 3
	print('|', end='')
	for i in range(1, 12):
		if i <= b1:
			print('O.', end='')
		else:
			print('#.', end='')
	print('|D|)')
	print('|', end='')
	for i in range(1, 12):
		if i <= b2:
			print('O.', end='')
		else:
			print('#.', end='')
	print('|.|')
	if b3 == 0:
		print('|#.......................|')
	else:
		print('|O.......................|')
	print('|', end='')
	for i in range(1, 12):
		if i <= b4:
			print('O.', end='')
		else:
			print('#.', end='')
	print('|.|)')
	print('+------------------------+')
main()


k = int(input())
print('+------------------------+')
a = (k - 4) // 3
b = (k - 4) % 3
if k == 0:
	print('|#.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|#.......................|')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
elif k == 1:
	print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|#.......................|')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
elif k == 2:
	print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|#.......................|')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
elif k == 3:
	print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|O.......................|')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
elif k == 4:
	print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|O.......................|')
	print('|O.#.#.#.#.#.#.#.#.#.#.|.|)')
elif b == 0:
	print('|O' + '.O' * a + '.#' * (10 - a) + '.|D|)')
	print('|O' + '.O' * a + '.#' * (10 - a) + '.|.|')
	print('|O.......................|')
	print('|O' + '.O' * a + '.#' * (10 - a) + '.|.|)')
elif b == 1:
	print('|O' + '.O' * (a + 1) + '.#' * (10 - a - 1) + '.|D|)')
	print('|O' + '.O' * a + '.#' * (10 - a) + '.|.|')
	print('|O.......................|')
	print('|O' + '.O' * a + '.#' * (10 - a) + '.|.|)')
elif b == 2:
	print('|O' + '.O' * (a + 1) + '.#' * (10 - a - 1) + '.|D|)')
	print('|O' + '.O' * (a + 1) + '.#' * (10 - a - 1) + '.|.|')
	print('|O.......................|')
	print('|O' + '.O' * a + '.#' * (10 - a) + '.|.|)')
print('+------------------------+')


import re
bus = '+------------------------+\n|1.5.8.11.14.17.20.23.26.29.32.|D|)\n|2.6.9.12.15.18.21.24.27.30.33.|.|\n|3.......................|\n|4.7.10.13.16.19.22.25.28.31.34.|.|)\n+------------------------+'
k = int(input())
bus = re.sub('\\d+', lambda m: 'O' if int(m.group()) <= k else '#', bus)
print(bus)


def imprime(onibus):
	print('+', end='')
	for i in range(24):
		print('-', end='')
	print('+')
	print('|', end='')
	for i in range(11):
		print(onibus[0][i], end='.')
	print('|D|)')
	print('|', end='')
	for i in range(11):
		print(onibus[1][i], end='.')
	print('|.|')
	print('|', end='')
	for i in range(11):
		print(onibus[2][i], end='.')
	print('..|')
	print('|', end='')
	for i in range(11):
		print(onibus[3][i], end='.')
	print('|.|)')
	print('+', end='')
	for i in range(24):
		print('-', end='')
	print('+')

def montaEsboco():
	fileira1 = []
	fileira2 = []
	fileira3 = []
	fileira4 = []
	for i in range(11):
		fileira1.append('#')
		fileira2.append('#')
		fileira4.append('#')
		if i == 0:
			fileira3.append('#')
		else:
			fileira3.append('.')
	onibus = [fileira1, fileira2, fileira3, fileira4]
	return onibus

def inserePassageiro(onibus, posicaoAInserir):
	onibus[posicaoAInserir[0]][posicaoAInserir[1]] = 'O'

def atualizaPosicaoAInserir(posicao):
	linha = posicao[0]
	coluna = posicao[1]
	if linha < 3:
		linha += 1
	else:
		linha = 0
		coluna += 1
	if linha == 2 and coluna >= 1:
		linha += 1
	return [linha, coluna]

def main():
	onibus = montaEsboco()
	qtdPassageiros = int(input())
	posicaoAInserir = [0, 0]
	for i in range(qtdPassageiros):
		inserePassageiro(onibus, posicaoAInserir)
		posicaoAInserir = atualizaPosicaoAInserir(posicaoAInserir)
	imprime(onibus)
main()


print((lambda x: '+' + '-' * 24 + '+\n|' + 'O.' * ((x + 2) // 3 if x < 3 else (x + 1) // 3) + '#.' * (11 - ((x + 2) // 3 if x < 3 else (x + 1) // 3)) + '|D|)\n|' + 'O.' * ((x + 1) // 3 if x < 3 else x // 3) + '#.' * (11 - ((x + 1) // 3 if x < 3 else x // 3)) + '|.|\n|' + ('O.' if x > 2 else '#.') + '..' * 10 + '..|\n|' + 'O.' * ((x - 1) // 3) + '#.' * min(11 - (x - 1) // 3, 11) + '|.|)\n+' + '-' * 24 + '+')(int(input())))


import sys
import math
n = int(sys.stdin.readline())
a = [['#'] * 11, ['#'] * 11, ['#', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['#'] * 11]
k = 0
for i in range(11):
	if k >= n:
		break
	for j in range(4):
		if k >= n:
			break
		if i < 1:
			a[j][i] = 'O'
		elif j != 2:
			a[j][i] = 'O'
		else:
			k -= 1
		k += 1
print('+------------------------+')
print('|' + '.'.join(a[0]) + '.|D|)')
print('|' + '.'.join(a[1]) + '.|.|')
print('|' + '.'.join(a[2]) + '...|')
print('|' + '.'.join(a[3]) + '.|.|)')
print('+------------------------+')


from sys import setrecursionlimit, exit, stdin
from math import ceil, floor, acos, pi
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from functools import reduce
import itertools
setrecursionlimit(10 ** 7)
RI = lambda x=' ': list(map(int, input().split(x)))
RS = lambda x=' ': input().rstrip().split(x)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
mod = int(1000000000.0 + 7)
eps = 1e-06
MAX = 1000
k = RI()[0]
s = '+------------------------+\n|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n+------------------------+'
s = list(s.split('\n'))
s = [list(i) for i in s]
for i in range(len(s[0])):
	for j in range(len(s)):
		if s[j][i] == '#' and k > 0:
			s[j][i] = 'O'
			k -= 1
print('\n'.join([''.join(i) for i in s]))


def proximoHashtag(v):
	for i in range(1, 22, 2):
		for j in range(0, 4):
			if j == 2 and i > 1:
				continue
			if v[j][i] == '#':
				v[j] = v[j][:i] + 'O' + v[j][i + 1:]
				return
n = int(input())
print('+------------------------+')
a = '|#.#.#.#.#.#.#.#.#.#.#.|D|)'
b = '|#.#.#.#.#.#.#.#.#.#.#.|.|'
c = '|#.......................|'
d = '|#.#.#.#.#.#.#.#.#.#.#.|.|)'
v = [a, b, c, d]
for i in range(0, n):
	proximoHashtag(v)
for i in range(0, 4):
	print(v[i])
print('+------------------------+')


numberoParticipantes = int(input())
participantes = ['temp'] * numberoParticipantes
primeraLinea = []
segundaLinea = []
terceraLinea = []
cuartaLinea = []
for k in range(0, 11):
	for l in range(0, 4):
		if l == 0 and len(participantes) > 0:
			primeraLinea.append('O')
			participantes.pop(0)
		elif l == 1 and len(participantes) > 0:
			segundaLinea.append('O')
			participantes.pop(0)
		elif k == 0 and l == 2 and (len(participantes) > 0):
			terceraLinea.append('O')
			participantes.pop(0)
		elif l == 3 and len(participantes) > 0:
			cuartaLinea.append('O')
			participantes.pop(0)
print('+------------------------+')
for i in range(0, 4):
	for j in range(0, 27):
		if j == 0 or (j == 23 and i != 2) or j == 25:
			print('|', end='')
		elif j == 26 and (i == 0 or i == 3):
			print(')', end='')
		elif j == 26 and (i == 1 or i == 2):
			print('', end='')
		elif j == 24 and i == 0:
			print('D', end='')
		elif j % 2 == 0 or (j > 1 and i == 2):
			print('.', end='')
		elif i == 0 and len(primeraLinea):
			print(primeraLinea.pop(), end='')
		elif i == 1 and len(segundaLinea):
			print(segundaLinea.pop(), end='')
		elif i == 2 and len(terceraLinea):
			print(terceraLinea.pop(), end='')
		elif i == 3 and len(cuartaLinea):
			print(cuartaLinea.pop(), end='')
		else:
			print('#', end='')
	print('')
print('+------------------------+')


n = int(input())
print('+------------------------+')
for i in range(3):
	print('|', end='')
	if i < 2 and i < n or i + 1 < n:
		print('O.', end='')
	else:
		print('#.', end='')
	for j in range(10):
		if n > 4 + j * 3 + i:
			print('O.', end='')
		else:
			print('#.', end='')
	if i == 0:
		print('|D|)')
	elif i == 1:
		print('|.|')
		if 3 <= n:
			print('|O.......................|')
		else:
			print('|#.......................|')
	elif i == 2:
		print('|.|)')
print('+------------------------+')


import math
k = 11
p = int(input())
print('+------------------------+')
print('|', end='')
if p > 4:
	t = 1 + math.ceil((p - 4) / 3)
	print(t * 'O.', end='')
	print((k - t) * '#.', end='')
elif p == 0:
	print(k * '#.', end='')
else:
	print('O.' + (k - 1) * '#.', end='')
print('|D|)')
print('|', end='')
if p > 4:
	t = 1 + (p - 4) // 3
	if (p - 4) % 3 == 2:
		t += 1
	print(t * 'O.', end='')
	print((k - t) * '#.', end='')
elif p < 2:
	print(k * '#.', end='')
else:
	print('O.' + (k - 1) * '#.', end='')
print('|.|')
print('|', end='')
if p < 3:
	print('#.......................|')
else:
	print('O.......................|')
print('|', end='')
if p > 4:
	t = 1 + (p - 4) // 3
	print(t * 'O.', end='')
	print((k - t) * '#.', end='')
elif p < 4:
	print(k * '#.', end='')
else:
	print('O.' + (k - 1) * '#.', end='')
print('|.|)')
print('+------------------------+')


n = int(input()) - 1
a = b = c = d = 0
if n == 0:
	a = 1
elif n == 1:
	a = b = 1
elif n > 1:
	a = b = d = n // 3
	(c, k) = (1, n % 3)
	if k > 0:
		a += 1
	if k > 1:
		b += 1
print('+------------------------+')
print('|' + 'O.' * a + '#.' * (11 - a) + '|D|)')
print('|' + 'O.' * b + '#.' * (11 - b) + '|.|')
print('|' + '#O'[c] + '.......................|')
print('|' + 'O.' * d + '#.' * (11 - d) + '|.|)')
print('+------------------------+')


k = int(input())
K = 0
if k < 4:
	pos = [False] * 4
	for i in range(k):
		pos[i] = True
	print('+------------------------+')
	print(['|#.#.#.#.#.#.#.#.#.#.#.|D|)', '|O.#.#.#.#.#.#.#.#.#.#.|D|)'][pos[0]])
	print(['|#.#.#.#.#.#.#.#.#.#.#.|.|', '|O.#.#.#.#.#.#.#.#.#.#.|.|'][pos[1]])
	print(['|#.......................|', '|O.......................|'][pos[2]])
	print(['|#.#.#.#.#.#.#.#.#.#.#.|.|)', '|O.#.#.#.#.#.#.#.#.#.#.|.|)'][pos[3]])
	print('+------------------------+')
else:
	pos = [[False] * 10 for i in range(3)]
	K = 4
	for j in range(10):
		for i in range(3):
			if K == k:
				break
			else:
				pos[i][j] = True
				K += 1
	print('+------------------------+')
	print('|O.', end='')
	for j in range(10):
		print(['#.', 'O.'][pos[0][j]], end='')
	print('|D|)')
	print('|O.', end='')
	for j in range(10):
		print(['#.', 'O.'][pos[1][j]], end='')
	print('|.|')
	print('|O.......................|')
	print('|O.', end='')
	for j in range(10):
		print(['#.', 'O.'][pos[2][j]], end='')
	print('|.|)')
	print('+------------------------+')


n = int(input())
a = ['#'] * 34
for i in range(n):
	a[i] = 'O'
print('+------------------------+')
print('|{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.|D|)'.format(a[0], a[4], a[7], a[10], a[13], a[16], a[19], a[22], a[25], a[28], a[31]))
print('|{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.|.|'.format(a[1], a[5], a[8], a[11], a[14], a[17], a[20], a[23], a[26], a[29], a[32]))
print('|' + a[2] + '.......................|')
print('|{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.|.|)'.format(a[3], a[6], a[9], a[12], a[15], a[18], a[21], a[24], a[27], a[30], a[33]))
print('+------------------------+')


from sys import stdin

def replace(c, n):
	for i in range(1, len(c[0]), 2):
		for j in range(1, 5):
			if n > 0:
				c[j][i] = c[j][i].replace('#', 'O')
				if c[j][i] == 'O':
					n = n - 1
	return c

def main():
	a1 = []
	bus = [['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', 'D', '|', ')'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', '.', '|'], ['|', '#', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '|'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', '.', '|', ')'], ['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+']]
	n = int(stdin.readline())
	bus = replace(bus, n)
	for i in range(0, len(bus)):
		print(''.join(bus[i]))
main()


n = int(input())
if n >= 4:
	n -= 4
	b = n // 3
	c = n % 3
	print('+------------------------+')
	if c > 0:
		print('|' + 'O.' + 'O.' * b + 'O.' + '#.' * (11 - (1 + b + 1)) + '|D|)')
		c -= 1
	else:
		print('|' + 'O.' + 'O.' * b + '#.' * (11 - (1 + b)) + '|D|)')
	if c > 0:
		print('|' + 'O.' + 'O.' * b + 'O.' + '#.' * (11 - (1 + b + 1)) + '|.|')
		c -= 1
	else:
		print('|' + 'O.' + 'O.' * b + '#.' * (11 - (1 + b)) + '|.|')
	print('|O.......................|')
	if c > 0:
		print('|' + 'O.' + 'O.' * b + 'O.' + '#.' * (11 - (1 + b + 1)) + '|.|)')
		c -= 1
	else:
		print('|' + 'O.' + 'O.' * b + '#.' * (11 - (1 + b)) + '|.|)')
	print('+------------------------+')
else:
	print('+------------------------+')
	if n > 0:
		print('|' + 'O.' + '#.' * 10 + '|D|)')
		n -= 1
	else:
		print('|' + '#.' + '#.' * 10 + '|D|)')
	if n > 0:
		print('|' + 'O.' + '#.' * 10 + '|.|')
		n -= 1
	else:
		print('|' + '#.' + '#.' * 10 + '|.|')
	if n > 0:
		print('|' + 'O.' + '..' * 10 + '..|')
		n -= 1
	else:
		print('|' + '#.' + '..' * 10 + '..|')
	if n > 0:
		print('|' + 'O.' + '#.' * 10 + '|.|)')
	else:
		print('|' + '#.' + '#.' * 10 + '|.|)')
	print('+------------------------+')


k = int(input())
a = k * 'O' + '#' * (34 - k)
print(f'+------------------------+')
print(f'|{a[0]}.{a[4]}.{a[7]}.{a[10]}.{a[13]}.{a[16]}.{a[19]}.{a[22]}.{a[25]}.{a[28]}.{a[31]}.|D|)')
print(f'|{a[1]}.{a[5]}.{a[8]}.{a[11]}.{a[14]}.{a[17]}.{a[20]}.{a[23]}.{a[26]}.{a[29]}.{a[32]}.|.|')
print(f'|{a[2]}.......................|')
print(f'|{a[3]}.{a[6]}.{a[9]}.{a[12]}.{a[15]}.{a[18]}.{a[21]}.{a[24]}.{a[27]}.{a[30]}.{a[33]}.|.|)')
print(f'+------------------------+')


from sys import stdin

def imprime(a):
	for i in range(0, len(a)):
		print(a[i], end='')

def main():
	bus = [['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+', ''], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', 'D', '|', ')'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', '.', '|', ''], ['|', '#', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '|', ''], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', '.', '|', ')'], ['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+', '']]
	a = int(input())
	cont = 0
	for i in range(27):
		for j in range(6):
			if bus[j][i] == '#':
				bus[j][i] = 'O'
				cont += 1
			if cont == a:
				break
	for i in range(len(bus)):
		imprime(bus[i])
		print()
main()


from math import floor, ceil
n = int(input())
print('+------------------------+')
firstrow = (1 if n > 0 else 0) + max(0, ceil((n - 4) / 3))
secondrow = (1 if n > 1 else 0) + max(0, ceil((n - 5) / 3))
thirdrow = 1 if n > 2 else 0
lastrow = (1 if n > 3 else 0) + max(0, ceil((n - 6) / 3))
print('|', end='')
for i in range(11):
	if i < firstrow:
		print('O.', end='')
	else:
		print('#.', end='')
print('|D|)')
print('|', end='')
for i in range(11):
	if i < secondrow:
		print('O.', end='')
	else:
		print('#.', end='')
print('|.|')
print('|', end='')
for i in range(11):
	if i == 0:
		if i < thirdrow:
			print('O.', end='')
		else:
			print('#.', end='')
	else:
		print('..', end='')
print('..|')
print('|', end='')
for i in range(11):
	if i < lastrow:
		print('O.', end='')
	else:
		print('#.', end='')
print('|.|)')
print('+------------------------+')


import itertools
k = int(input())
spots = [(1, 1), (2, 1), (3, 1), (4, 1)] + list(itertools.chain.from_iterable([[(1, i), (2, i), (4, i)] for i in range(3, 23, 2)]))
bus = [''] * 6
bus[0] = list('+------------------------+')
bus[1] = list('|#.#.#.#.#.#.#.#.#.#.#.|D|)')
bus[2] = list('|#.#.#.#.#.#.#.#.#.#.#.|.|')
bus[3] = list('|#.......................|')
bus[4] = list('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
bus[5] = list('+------------------------+')
for i in range(k):
	(r, c) = spots[i]
	bus[r][c] = 'O'
for b in bus:
	print(''.join(b))


k = int(input())
seats = (28, 56, 83, 110, 30, 58, 112, 32, 60, 114, 34, 62, 116, 36, 64, 118, 38, 66, 120, 40, 68, 122, 42, 70, 124, 44, 72, 126, 46, 74, 128, 48, 76, 130)
bus = list('+------------------------+\n|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n+------------------------+')
for i in seats[:k]:
	bus[i] = 'O'
print(''.join(bus))


k = int(input())
strin0 = '#.#.#.#.#.#.#.#.#.#.#'
lista = strin0.split('.')
strin1 = '#.#.#.#.#.#.#.#.#.#.#'
lista1 = strin1.split('.')
strin2 = '#'
lista2 = strin2.split('.')
strin3 = '#.#.#.#.#.#.#.#.#.#.#'
lista3 = strin3.split('.')
stringprint = '.'
stringprint1 = '.'
stringprint2 = '.'
stringprint3 = '.'
i = 0
j = 0
while i != k:
	lista[j] = 'O'
	i = i + 1
	if i == k:
		break
	lista1[j] = 'O'
	i = i + 1
	if i == k:
		break
	if lista2[0] != 'O':
		lista2[0] = 'O'
		i = i + 1
	if i == k:
		break
	lista3[j] = 'O'
	i = i + 1
	j = j + 1
stringprint = stringprint.join(lista)
stringprint1 = stringprint1.join(lista1)
stringprint2 = stringprint2.join(lista2)
stringprint3 = stringprint3.join(lista3)
print('+------------------------+')
print('|' + stringprint + '.' + '|D|)')
print('|' + stringprint1 + '.' + '|.|')
print('|' + stringprint2 + '.......................' + '|')
print('|' + stringprint3 + '.|.|)')
print('+------------------------+')


a = ['+------------------------+', '|#.#.#.#.#.#.#.#.#.#.#.|D|)', '|#.#.#.#.#.#.#.#.#.#.#.|.|', '|#.......................|', '|#.#.#.#.#.#.#.#.#.#.#.|.|)', '+------------------------+']
n = int(input())
row = 1
pos = 1
for i in range(n):
	a[pos] = a[pos][:row] + 'O' + a[pos][row + 1:]
	pos += 1
	if row != 1 and pos == 3:
		pos += 1
	if pos > 4:
		pos = 1
		row += 2
for x in a:
	print(x)


from sys import stdin

def anfe():
	a = int(stdin.readline())
	b = [['|', '|', '|', '|'], ['#', '#', '#', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['#', '#', '.', '#'], ['.', '.', '.', '.'], ['|', '|', '.', '|'], ['D', '.', '.', '.'], ['|', '|', '|', '|'], [')\n', '\n', '\n', ')\n']]
	for k in range(len(b)):
		if '#' in b[k]:
			for l in range(len(b[k])):
				if a > 0 and b[k][l] == '#':
					b[k][l] = 'O'
					a -= 1
	print('+------------------------+')
	for j in range(4):
		for m in range(27):
			print(b[m][j], end='')
	print('+------------------------+')
anfe()


v = '+------------------------+\n|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n+------------------------+'.split()

def sr(n):
	w = 4
	(a, b) = (n // w, n % w)
	vn = w * [a]
	for c in range(b):
		vn[c] += 1
	for c in range(1, w + 1):
		v[c] = v[c].replace('#', 'O', vn[c - 1])
n = int(input())
if n > 5:
	n += n // 3 - 1
sr(n)
for c in v:
	print(c)


k = int(input())
print('+------------------------+')
a = 0
b = 0
c = 0
d = 0
if k < 4:
	s = '|#.......................|'
	if k == 1:
		(a, b, c, d) = (1, 0, 0, 0)
	if k == 2:
		(a, b, c, d) = (1, 1, 0, 0)
	if k == 3:
		(a, b, c, d) = (1, 1, 1, 0)
		s = '|O.......................|'
else:
	(a, b, c, d) = (1, 1, 1, 1)
	k = k - 4
	k1 = k // 3
	a = a + k1
	b = b + k1
	d = d + k1
	k = k % 3
	s = '|O.......................|'
	if k == 1:
		a += 1
	if k == 2:
		a += 1
		b += 1
print('|' + a * 'O.' + (11 - a) * '#.' + '|D|)')
print('|' + b * 'O.' + (11 - b) * '#.' + '|.|')
print(s)
print('|' + d * 'O.' + (11 - d) * '#.' + '|.|)')
print('+------------------------+')


k = int(input())
busSide = '+------------------------+'
row1 = '|#.#.#.#.#.#.#.#.#.#.#.|D|)'
row2 = '|#.#.#.#.#.#.#.#.#.#.#.|.|'
row3 = '|#.......................|'
row4 = '|#.#.#.#.#.#.#.#.#.#.#.|.|)'
index = 0
arr = [row1, row2, row3, row4]
while k > 0:
	placed = False
	for i in range(len(arr)):
		if arr[i][index] is '#':
			arr[i] = arr[i][:index] + 'O' + arr[i][index + 1:]
			placed = True
			break
	if not placed:
		index += 1
		continue
	k -= 1
print(busSide + '\n' + arr[0] + '\n' + arr[1] + '\n' + arr[2] + '\n' + arr[3] + '\n' + busSide)


k = int(input())
l = [['#'] * 11, ['#'] * 11, ['#'], ['#'] * 11]
if k > 4:
	for i in range(4):
		l[i][0] = 'O'
	k -= 4
else:
	for i in range(k):
		l[i][0] = 'O'
	k = 0
for i in range(1, (k + 2) // 3 + 1):
	if k >= 3:
		k -= 3
		l[0][i] = 'O'
		l[1][i] = 'O'
		l[3][i] = 'O'
	elif k == 2:
		k = 0
		l[0][i] = 'O'
		l[1][i] = 'O'
	elif k == 1:
		k = 0
		l[0][i] = 'O'
print('+------------------------+')
print('|', '.'.join(l[0]), '.|D|)', sep='')
print('|', '.'.join(l[1]), '.|.|', sep='')
print('|', l[2][0], '.......................|', sep='')
print('|', '.'.join(l[3]), '.|.|)', sep='')
print('+------------------------+')


s = ['+------------------------+', '|#.#.#.#.#.#.#.#.#.#.#.|D|)', '|#.#.#.#.#.#.#.#.#.#.#.|.|', '|#.......................|', '|#.#.#.#.#.#.#.#.#.#.#.|.|)', '+------------------------+']
k = int(input())
for _ in range(k):
	fnd = False
	for j in range(22):
		if fnd:
			break
		for i in range(6):
			if s[i][j] == '#':
				s[i] = s[i][:j] + 'O' + s[i][j + 1:]
				fnd = True
				break
print('\n'.join(s))


import sys
slika = '+------------------------+\n|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n+------------------------+'
st = int(sys.stdin.readline())
lines = [list(line) for line in slika.split('\n')]
w = min((len(line) for line in lines))
for k in range(w):
	if st == 0:
		break
	for l in range(len(lines)):
		if st == 0:
			break
		if lines[l][k] == '#':
			lines[l][k] = 'O'
			st -= 1
for line in lines:
	print(''.join(line))


import sys

def main():
	while 1:
		try:
			line = sys.stdin.readline()
			solve(line)
			break
		except KeyboardInterrupt:
			break
pas = ['#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#']

def solve(line):
	for x in range(0, int(line)):
		pas[x] = 'O'
	print('+------------------------+')
	print('|{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.|D|)'.format(pas[0], pas[4], pas[7], pas[10], pas[13], pas[16], pas[19], pas[22], pas[25], pas[28], pas[31]))
	print('|{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.|.|'.format(pas[1], pas[5], pas[8], pas[11], pas[14], pas[17], pas[20], pas[23], pas[26], pas[29], pas[32]))
	print('|{}.......................|'.format(pas[2]))
	print('|{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.{}.|.|)'.format(pas[3], pas[6], pas[9], pas[12], pas[15], pas[18], pas[21], pas[24], pas[27], pas[30], pas[33]))
	print('+------------------------+')
main()


ans = '\n'.join(['+------------------------+', '|0.4.7.A.(.G.J.M.P.S.V.|D|)', '|1.5.8.B.E.H.K.N.Q.T.W.|.|', '|2.......................|', '|3.6.9.C.F.I.L.s.R.U.X.|.|)', '+------------------------+'])
line = '0123456789ABC(EFGHIJKLMNsPQRSTUVWX'
n = int(input())
for i in range(n):
	ans = ans.replace(line[i], 'O')
for i in range(n, 34, 1):
	ans = ans.replace(line[i], '#')
print(ans)


k = int(input())
i = 1
print('+------------------------+')
n = k
r1 = 0
r2 = 0
r3 = 0
r4 = 0
if k >= 4:
	n -= 4
	r1 = 1
	r2 = 1
	r4 = 1
	r3 = 1
else:
	if n > 0:
		r1 = 1
		n -= 1
	if n > 0:
		r2 = 1
		n -= 1
	if n > 0:
		r3 = 1
		n -= 1
r4 += n // 3
r1 += n // 3
r2 += n // 3
if n % 3 == 1:
	r1 += +1
elif n % 3 == 2:
	r1 += 1
	r2 += 1
print('|' + 'O.' * r1 + '#.' * (11 - r1) + '|D|)')
print('|' + 'O.' * r2 + '#.' * (11 - r2) + '|.|')
print('|' + 'O' * r3 + '#' * (1 - r3) + '.......................|')
print('|' + 'O.' * r4 + '#.' * (11 - r4) + '|.|)')
print('+------------------------+')


n = int(input())
print('+------------------------+')
print('|', end='')
a = 0
b = 0
c = 0
if n >= 4:
	for i in range(n - 4):
		if i % 3 == 0:
			a += 1
		elif i % 3 == 1:
			b += 1
		else:
			c += 1
if n >= 1:
	print('O.', end='')
else:
	print('#.', end='')
for i in range(1, 11):
	if i > a:
		print('#.', end='')
	else:
		print('O.', end='')
print('|D|)')
print('|', end='')
if n >= 2:
	print('O.', end='')
else:
	print('#.', end='')
for i in range(1, 11):
	if i > b:
		print('#.', end='')
	else:
		print('O.', end='')
print('|.|')
print('|', end='')
if n >= 3:
	print('O.', end='')
else:
	print('#.', end='')
print('......................|')
print('|', end='')
if n >= 4:
	print('O.', end='')
else:
	print('#.', end='')
for i in range(1, 11):
	if i > c:
		print('#.', end='')
	else:
		print('O.', end='')
print('|.|)')
print('+------------------------+')


n = int(input())
a = [['#', '#', '#' if i == 0 else '.', '#'] for i in range(11)]
for r in range(11):
	for c in range(4):
		if a[r][c] == '#' and n > 0:
			a[r][c] = 'O'
			n -= 1
print('+' + '-' * 24 + '+')
print('|' + '.'.join([a[i][0] for i in range(11)]) + '.|D|)')
print('|' + '.'.join([a[i][1] for i in range(11)]) + '.|.|')
print('|' + '.'.join([a[i][2] for i in range(11)]) + '...|')
print('|' + '.'.join([a[i][3] for i in range(11)]) + '.|.|)')
print('+' + '-' * 24 + '+')


n = int(input())
a = [0] * 11
if n < 4:
	a[0] = n
	n = 0
else:
	a[0] = 4
	n -= 4
	i = 1
	while n > 0:
		if n < 3:
			a[i] = n
			n = 0
		else:
			a[i] = 3
			n -= 3
		i += 1

def pb(x):
	global a
	for i in a[1:]:
		print('O' if i >= x else '#', end='.')
print('+------------------------+')
print(end='|')
print('O' if a[0] >= 1 else '#', end='.')
pb(1)
print('|D|)')
print(end='|')
print('O' if a[0] >= 2 else '#', end='.')
pb(2)
print('|.|')
print(end='|')
print('O' if a[0] >= 3 else '#', end='')
print('.......................|')
print(end='|')
print('O' if a[0] >= 4 else '#', end='.')
pb(3)
print('|.|)')
print('+------------------------+')


n = int(input())
line1 = '+------------------------+'
row1 = ['#'] * 11
row2 = ['#'] * 11
row3 = ['#'] + ['.'] * 10
row4 = ['#'] * 11
for i in range(1, n + 1):
	if i <= 4:
		if i == 1:
			row1[0] = 'O'
		elif i == 2:
			row2[0] = 'O'
		elif i == 3:
			row3[0] = 'O'
		elif i == 4:
			row4[0] = 'O'
	else:
		di = i - 4
		if di % 3 == 1:
			row1[row1.index('#')] = 'O'
		elif di % 3 == 2:
			row2[row2.index('#')] = 'O'
		elif di % 3 == 0:
			row4[row4.index('#')] = 'O'
print(line1)
print('|' + '.'.join(row1) + '.|D|)')
print('|' + '.'.join(row2) + '.|.|')
print('|' + '.'.join(row3) + '...|')
print('|' + '.'.join(row4) + '.|.|)')
print(line1)


A = '+------------------------+\n|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n+------------------------+'
B = A.split()
for i in range(6):
	B[i] = list(B[i])
k = int(input())
for i in range(len(B[0])):
	for j in range(6):
		if B[j][i] == '#' and k > 0:
			B[j][i] = 'O'
			k -= 1
for i in range(6):
	print(''.join(B[i]))


def printBus(lastRow, otherRows):
	s = '+------------------------+\n'
	for i in range(4):
		s += '|' + lastRow[i] + '.'
		for j in range(10):
			if i == 2:
				s += '..'
			elif i == 3:
				s += otherRows[j][i - 1] + '.'
			else:
				s += otherRows[j][i] + '.'
		if i == 0:
			s += '|D|)'
		elif i == 1:
			s += '|.|'
		elif i == 2:
			s += '..|'
		else:
			s += '|.|)'
		s += '\n'
	s += '+------------------------+'
	print(s)

def solve(n):
	lastRow = []
	otherRows = [[]]
	while n > 0:
		if len(lastRow) < 4:
			lastRow.append('O')
		elif len(otherRows[-1]) < 3:
			otherRows[-1].append('O')
		else:
			otherRows.append(['O'])
		n -= 1
	otherRows += [[] for _ in range(10 - len(otherRows))]
	lastRow += (4 - len(lastRow)) * ['#']
	for row in otherRows:
		row += (3 - len(row)) * ['#']
	printBus(lastRow, otherRows)
n = int(input())
solve(n)


def main():
	K = int(input())
	bus = [list('+------------------------+'), list('|#.#.#.#.#.#.#.#.#.#.#.|D|)'), list('|#.#.#.#.#.#.#.#.#.#.#.|.|'), list('|#.......................|'), list('|#.#.#.#.#.#.#.#.#.#.#.|.|)'), list('+------------------------+')]
	for i in range(K):
		if i < 4:
			bus[i + 1][1] = 'O'
		elif (i - 4) % 3 + 1 == 3:
			bus[(i - 4) % 3 + 2][2 * ((i - 4) // 3) + 3] = 'O'
		else:
			bus[(i - 4) % 3 + 1][2 * ((i - 4) // 3) + 3] = 'O'
	for line in bus:
		print(''.join(line))
main()


n = int(input())
s = ['+------------------------+', '|#.#.#.#.#.#.#.#.#.#.#.|D|)', '|#.#.#.#.#.#.#.#.#.#.#.|.|', '|#.......................|', '|#.#.#.#.#.#.#.#.#.#.#.|.|)', '+------------------------+']
for i in range(22):
	for j in range(5):
		if n and s[j][i] == '#':
			n -= 1
			s[j] = s[j][:i] + 'O' + s[j][i + 1:]
print('\n'.join(s))


n = int(input())
print('+------------------------+')
if n > 4:
	if (n - 4) % 3 == 0:
		r1 = 1 + (n - 4) // 3
		r2 = r1
		r3 = r1
	elif (n - 4) % 3 == 1:
		r1 = 2 + (n - 4) // 3
		r2 = 1 + (n - 4) // 3
		r3 = r2
	else:
		r1 = 2 + (n - 4) // 3
		r2 = r1
		r3 = 1 + (n - 4) // 3
	print('|', end='')
	for i in range(r1):
		print('O.', end='')
	for i in range(11 - r1):
		print('#.', end='')
	print('|D|)')
	print('|', end='')
	for i in range(r2):
		print('O.', end='')
	for i in range(11 - r2):
		print('#.', end='')
	print('|.|')
	print('|O.......................|')
	print('|', end='')
	for i in range(r3):
		print('O.', end='')
	for i in range(11 - r3):
		print('#.', end='')
	print('|.|)')
	print('+------------------------+')
else:
	if n == 0:
		r1 = 0
		r2 = 0
		r3 = 0
	elif n == 1:
		r1 = 1
		r2 = 0
		r3 = 0
	elif n == 2 or n == 3:
		r1 = 1
		r2 = 1
		r3 = 0
	elif n == 4:
		r1 = 1
		r2 = 1
		r3 = 1
	print('|', end='')
	for i in range(r1):
		print('O.', end='')
	for i in range(11 - r1):
		print('#.', end='')
	print('|D|)')
	print('|', end='')
	for i in range(r2):
		print('O.', end='')
	for i in range(11 - r2):
		print('#.', end='')
	print('|.|')
	if n < 3:
		print('|#.......................|')
	else:
		print('|O.......................|')
	print('|', end='')
	for i in range(r3):
		print('O.', end='')
	for i in range(11 - r3):
		print('#.', end='')
	print('|.|)')
	print('+------------------------+')


import math
k = int(input())

def row(x, y):
	print('|O.' + 'O.' * x + '#.' * (10 - x) + '|' + y)
print('+------------------------+')
if k == 0:
	print('|#.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|#.......................|')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
	print('+------------------------+')
	quit()
if k == 1:
	print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|#.......................|')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
	print('+------------------------+')
	quit()
if k == 2:
	print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|#.......................|')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
	print('+------------------------+')
	quit()
if k == 3:
	print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|O.......................|')
	print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
	print('+------------------------+')
	quit()
if k == 4:
	print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
	print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
	print('|O.......................|')
	print('|O.#.#.#.#.#.#.#.#.#.#.|.|)')
	print('+------------------------+')
	quit()
if (k - 4) % 3 == 1:
	row(math.ceil((k - 4) / 3), 'D|)')
	row(math.ceil((k - 4) / 3) - 1, '.|')
	print('|O.......................|')
	row(math.ceil((k - 4) / 3) - 1, '.|)')
if (k - 4) % 3 == 2:
	row(math.ceil((k - 4) / 3), 'D|)')
	row(math.ceil((k - 4) / 3), '.|')
	print('|O.......................|')
	row(math.ceil((k - 4) / 3) - 1, '.|)')
if (k - 4) % 3 == 0:
	row(math.ceil((k - 4) / 3), 'D|)')
	row(math.ceil((k - 4) / 3), '.|')
	print('|O.......................|')
	row(math.ceil((k - 4) / 3), '.|)')
print('+------------------------+')


n = int(input())
print('+------------------------+')
seats = []
for i in range(3):
	seats.append(['|'])
i = 0
if n > 2:
	row_3 = '|O.......................|'
	n -= 1
else:
	row_3 = '|#.......................|'
for j in range(33):
	if n > 0:
		seats[i].append('O.')
		n -= 1
	else:
		seats[i].append('#.')
	i = (i + 1) % 3
seats[0].append('|D|)')
seats[1].append('|.|')
seats[2].append('|.|)')
for i in range(3):
	string = ''
	if i == 2:
		print(row_3)
	for element in seats[i]:
		string += str(element)
	print(string)
print('+------------------------+')


from sys import stdin

def bayan():
	while True:
		n = str(stdin.readline().strip())
		if len(n) == 0:
			break
		else:
			mat = [['#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#'], ['#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#'], ['#', '', '', '', '', '', '', '', '', '', ''], ['#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#']]
			mat = pasajero(int(n), mat)
			imp(mat)

def pasajero(n, mat):
	col = 0
	while col <= 10:
		fila = 0
		while fila <= 3:
			if n == 0:
				break
			elif fila == 2 and col > 0:
				n = n + 1
			else:
				mat[fila][col] = 'O'
			n -= 1
			fila += 1
		col += 1
	return mat

def imp(mat):
	f1 = mat[0]
	f2 = mat[1]
	f3 = mat[2]
	f4 = mat[3]
	f1 = '.'.join(f1)
	f2 = '.'.join(f2)
	f3 = '.'.join(f3)
	f4 = '.'.join(f4)
	print('+' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '+')
	print('|' + f1 + '.' + '|' + 'D' + '|' + ')')
	print('|' + f2 + '.' + '|' + '.' + '|')
	print('|' + f3 + '.' + '.' + '.' + '.' + '.' + '.' + '.' + '.' + '.' + '.' + '.' + '.' + '.' + '|')
	print('|' + f4 + '.' + '|' + '.' + '|' + ')')
	print('+' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '+')
bayan()


k = int(input())
s = [''] * 6
s[0] = '+------------------------+'
s[1] = '|#.#.#.#.#.#.#.#.#.#.#.|D|)'
s[2] = '|#.#.#.#.#.#.#.#.#.#.#.|.|'
s[3] = '|#.......................|'
s[4] = '|#.#.#.#.#.#.#.#.#.#.#.|.|)'
s[5] = '+------------------------+'
curs = 1
while k > 0:
	while not '#' in s[curs]:
		curs = 1 + curs % 4
	x = s[curs].index('#')
	s[curs] = s[curs][:x] + 'O' + s[curs][x + 1:]
	curs = 1 + curs % 4
	k -= 1
for i in s:
	print(i)


from sys import stdin

def llenar(bus, cont):
	new = []
	new = transpuesta(bus)
	for i in range(len(new)):
		for j in range(len(new[i])):
			if cont != 0:
				if new[i][j] == '#':
					new[i][j] = 'O'
					cont -= 1
	return transpuesta(new)

def transpuesta(sitp):
	a = []
	for i in range(len(sitp[0])):
		b = []
		for j in range(len(sitp)):
			b.append(sitp[j][i])
		a.append(b)
	return a

def main():
	buseta = [['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '--+'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|D|)'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|.|'], ['|', '#', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '..|'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|.|)'], ['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '--+']]
	cont = stdin.readline().strip()
	while cont != '':
		x = llenar(buseta, int(cont))
		for i in range(len(buseta)):
			print(''.join(x[i]))
		cont = stdin.readline().strip()
main()


k = int(input())
a = [list() for i in range(6)]
a[0] = a[5] = list('+------------------------+')
a[1] = list('|' + '#.' * 11 + '|D|)')
a[2] = list('|' + '#.' * 11 + '|.|')
a[3] = list('|' + '#' + '.' * 23 + '|')
a[4] = list('|' + '#.' * 11 + '|.|)')
x = y = 1
for i in range(k):
	a[x][y] = 'O'
	if x == 4:
		x = 1
		y += 2
	elif x == 2 and y != 1:
		x += 2
	else:
		x += 1
print('\n'.join(map(lambda x: ''.join(x), a)))


a = [list('+------------------------+'), list('|#.#.#.#.#.#.#.#.#.#.#.|D|)'), list('|#.#.#.#.#.#.#.#.#.#.#.|.|'), list('|#.......................|'), list('|#.#.#.#.#.#.#.#.#.#.#.|.|)'), list('+------------------------+')]
a = list(a)
k = int(input())
if k < 4:
	for i in range(k):
		a[1 + i][1] = 'O'
else:
	for i in range(4):
		a[1 + i][1] = 'O'
	k -= 4
	for i in range(k):
		r = i % 3
		if r == 0:
			a[1][i // 3 * 2 + 3] = 'O'
		elif r == 1:
			a[2][i // 3 * 2 + 3] = 'O'
		elif r == 2:
			a[4][i // 3 * 2 + 3] = 'O'
for i in a:
	print(''.join(i))


k = int(input())
i = 0
j = 0
a = ['#'] * 11
b = ['#'] * 11
d = ['#'] * 11
c = ['#']
bus = [a, b, c, d]
while k > 0:
	if j == 2 and i > 0:
		j = j + 1
	bus[j][i] = 'O'
	j = j + 1
	if j == 4:
		j = 0
		i = i + 1
	k = k - 1
print('+------------------------+')
s = '|'
i = 0
while i < len(a):
	s = s + a[i] + '.'
	i = i + 1
s = s + '|D|)'
print(s)
s = '|'
i = 0
while i < len(b):
	s = s + b[i] + '.'
	i = i + 1
s = s + '|.|'
print(s)
s = '|'
i = 0
while i < len(c):
	s = s + c[i] + '.'
	i = i + 1
s = s + '......................|'
print(s)
s = '|'
i = 0
while i < len(d):
	s = s + d[i] + '.'
	i = i + 1
s = s + '|.|)'
print(s)
print('+------------------------+')


k = int(input())

def print_limit():
	print('+------------------------+')

def print_line(n, driver=False, empty=False, light=False):
	l = '|#.#.#.#.#.#.#.#.#.#.#.|.|'
	if driver:
		l = l.replace('|.|', '|D|)')
	if light:
		l = l.replace('|.|', '|.|)')
	if empty:
		l = '|#.......................|'
	l = l.replace('#', 'O', n)
	print(l)

def add_to_line(l, c):
	if c == 2 and l[2] > 0:
		c = c + 1
	c = c % 4
	l[c] = l[c] + 1
	c = c + 1
	return c
current = 0
l = [0, 0, 0, 0]
while k > 0:
	current = add_to_line(l, current)
	k = k - 1
print_limit()
for i in range(0, len(l)):
	if i == 0:
		print_line(l[i], driver=True)
	elif i == 2:
		print_line(l[i], empty=True)
	elif i == 3:
		print_line(l[i], light=True)
	else:
		print_line(l[i])
print_limit()


k = int(input())
values = [['#' for i in range(11)] for i in range(3)]
for i in range(k - 1 if k > 2 else k):
	values[i % 3][i // 3] = 'O'
print('+------------------------+')
print('|' + '.'.join(values[0]) + '.|D|)')
print('|' + '.'.join(values[1]) + '.|.|')
print('|' + ('O' if k > 2 else '#') + '.......................|')
print('|' + '.'.join(values[2]) + '.|.|)')
print('+------------------------+')


n = int(input())
s = ['+------------------------+']
d = '|' + '#O'[n > 2] + '.' * 23 + '|'
if n > 2:
	n -= 1
for i in range(3):
	x = n // 3 + (n % 3 > i)
	s += ['|' + '.'.join('O' * x + '#' * (11 - x))]
s.insert(3, d)
s += [s[0]]
s[1] += '.|D|)'
s[2] += '.|.|'
s[4] += '.|.|)'
print('\n'.join(s))


n = int(input())
pls = [['#', '#', '#', '#'] for i in range(11)]
for i in range(1, 11):
	pls[i][2] = ''
for i in range(11):
	for j in range(4):
		if n == 0:
			break
		if pls[i][j] != '':
			pls[i][j] = 'O'
			n -= 1
print('+------------------------+')
print('|' + pls[0][0], pls[1][0], pls[2][0], pls[3][0], pls[4][0], pls[5][0], pls[6][0], pls[7][0], pls[8][0], pls[9][0], pls[10][0], '|D|)', sep='.')
print('|' + pls[0][1], pls[1][1], pls[2][1], pls[3][1], pls[4][1], pls[5][1], pls[6][1], pls[7][1], pls[8][1], pls[9][1], pls[10][1], '|.|', sep='.')
print('|' + pls[0][2], pls[1][2], pls[2][2], pls[3][2], pls[4][2], pls[5][2], pls[6][2], pls[7][2], pls[8][2], pls[9][2], pls[10][2], '............|', sep='.')
print('|' + pls[0][3], pls[1][3], pls[2][3], pls[3][3], pls[4][3], pls[5][3], pls[6][3], pls[7][3], pls[8][3], pls[9][3], pls[10][3], '|.|)', sep='.')
print('+------------------------+')


inpput = int(input())
if inpput >= 4:
	inpput -= 4
	bayan = inpput // 3
	c = inpput % 3
	print('+------------------------+')
	if c > 0:
		print('|' + 'O.' + 'O.' * bayan + 'O.' + '#.' * (11 - (1 + bayan + 1)) + '|D|)')
		c -= 1
	else:
		print('|' + 'O.' + 'O.' * bayan + '#.' * (11 - (1 + bayan)) + '|D|)')
	if c > 0:
		print('|' + 'O.' + 'O.' * bayan + 'O.' + '#.' * (11 - (1 + bayan + 1)) + '|.|')
		c -= 1
	else:
		print('|' + 'O.' + 'O.' * bayan + '#.' * (11 - (1 + bayan)) + '|.|')
	print('|O.......................|')
	if c > 0:
		print('|' + 'O.' + 'O.' * bayan + 'O.' + '#.' * (11 - (1 + bayan + 1)) + '|.|)')
		c -= 1
	else:
		print('|' + 'O.' + 'O.' * bayan + '#.' * (11 - (1 + bayan)) + '|.|)')
	print('+------------------------+')
else:
	print('+------------------------+')
	if inpput > 0:
		print('|' + 'O.' + '#.' * 10 + '|D|)')
		inpput -= 1
	else:
		print('|' + '#.' + '#.' * 10 + '|D|)')
	if inpput > 0:
		print('|' + 'O.' + '#.' * 10 + '|.|')
		inpput -= 1
	else:
		print('|' + '#.' + '#.' * 10 + '|.|')
	if inpput > 0:
		print('|' + 'O.' + '..' * 10 + '..|')
		inpput -= 1
	else:
		print('|' + '#.' + '..' * 10 + '..|')
	if inpput > 0:
		print('|' + 'O.' + '#.' * 10 + '|.|)')
	else:
		print('|' + '#.' + '#.' * 10 + '|.|)')
	print('+------------------------+')


n = int(input())
a = [['#' for i in range(11)] for j in range(4)]
i = 0
j = 0
while n > 0:
	a[j][i] = 'O'
	if j == 3:
		i += 1
		j = 0
	else:
		j += 1
		if j == 2 and i > 0:
			j += 1
	n -= 1
print('+------------------------+')
print('|' + a[0][0] + '.' + a[0][1] + '.' + a[0][2] + '.' + a[0][3] + '.' + a[0][4] + '.' + a[0][5] + '.' + a[0][6] + '.' + a[0][7] + '.' + a[0][8] + '.' + a[0][9] + '.' + a[0][10] + '.|D|)')
print('|' + a[1][0] + '.' + a[1][1] + '.' + a[1][2] + '.' + a[1][3] + '.' + a[1][4] + '.' + a[1][5] + '.' + a[1][6] + '.' + a[1][7] + '.' + a[1][8] + '.' + a[1][9] + '.' + a[1][10] + '.|.|')
print('|' + a[2][0] + '.......................|')
print('|' + a[3][0] + '.' + a[3][1] + '.' + a[3][2] + '.' + a[3][3] + '.' + a[3][4] + '.' + a[3][5] + '.' + a[3][6] + '.' + a[3][7] + '.' + a[3][8] + '.' + a[3][9] + '.' + a[3][10] + '.|.|)')
print('+------------------------+')


def sol(A):
	print('+------------------------+')
	for i in range(4):
		for j in range(11):
			if j == 0:
				if A[i][j] == 1:
					A[i][j] = '|O'
				else:
					A[i][j] = '|#'
			elif i == 2:
				A[i][j] = '.'
			elif A[i][j] == 1:
				A[i][j] = '.O'
			else:
				A[i][j] = '.#'
		if i == 0:
			A[i].append('.|D|)')
		elif i == 2:
			for _ in range(13):
				A[i].append('.')
			A[i].append('|')
		elif i == 3:
			A[i].append('.|.|)')
		else:
			A[i].append('.|.|')
	for row in A:
		print(''.join(row))
	print('+------------------------+')
k = int(input())
j = 0
A = [[None for y in range(11)] for x in range(4)]
if k == 0:
	sol(A)
while k > 0:
	while k > 0 and j < 11:
		i = 0
		if j == 0:
			while k > 0 and i < 4:
				A[i][j] = 1
				i += 1
				k -= 1
			if k == 0:
				sol(A)
		else:
			while k > 0 and i < 4:
				if i == 2:
					i += 1
					continue
				else:
					A[i][j] = 1
					i += 1
					k -= 1
			if k == 0:
				sol(A)
		j += 1


passenger_count = int(input())
real_count = passenger_count
if passenger_count > 2:
	passenger_count = passenger_count - 1
rem_seat = passenger_count % 3
passenger_col = int(passenger_count / 3)
print('+------------------------+')

def printRow(endString, rem_seat):
	row = '|'
	for i in range(11):
		if i < passenger_col:
			row = row + 'O.'
		elif i == passenger_col and rem_seat > 0:
			rem_seat = rem_seat - 1
			row = row + 'O.'
		else:
			row = row + '#.'
	row = row + endString
	print(row)
	return rem_seat
rem_seat = printRow('|D|)', rem_seat)
rem_seat = printRow('|.|', rem_seat)
if real_count > 2:
	print('|O.......................|')
else:
	print('|#.......................|')
rem_seat = printRow('|.|)', rem_seat)
print('+------------------------+')


out = [bytearray(b'+------------------------+'), bytearray(b'|O.O.O.#.#.#.#.#.#.#.#.|D|)'), bytearray(b'|O.O.O.#.#.#.#.#.#.#.#.|.|'), bytearray(b'|O.......................|'), bytearray(b'|O.O.#.#.#.#.#.#.#.#.#.|.|)'), bytearray(b'+------------------------+')]
k = int(input())
verlist = [2, 4, 1]
for i in range(1, 35):
	c = '#' if i > k else 'O'
	hor = 1 if i < 5 else (i - 2) // 3 * 2 + 1
	ver = i if i < 5 else verlist[i % 3]
	out[ver][hor] = ord(c)
for s in out:
	print(s.decode())


k = int(input())
print('+------------------------+')
if k <= 4:
	if k > 0:
		print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
	else:
		print('|#.#.#.#.#.#.#.#.#.#.#.|D|)')
	if k > 1:
		print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
	else:
		print('|#.#.#.#.#.#.#.#.#.#.#.|.|')
	if k > 2:
		print('|O.......................|')
	else:
		print('|#.......................|')
	if k > 3:
		print('|O.#.#.#.#.#.#.#.#.#.#.|.|)')
	else:
		print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
else:
	k -= 4
	first = k // 3 + 1
	if k % 3 > 0:
		first += 1
	second = k // 3 + 1
	if k % 3 > 1:
		second += 1
	third = k // 3 + 1
	print('|', 'O.' * first, '#.' * (11 - first), '|D|)', sep='')
	print('|', 'O.' * second, '#.' * (11 - second), '|.|', sep='')
	print('|O.......................|')
	print('|', 'O.' * third, '#.' * (11 - third), '|.|)', sep='')
print('+------------------------+')


k = int(input())
bus = []
bus.append([])
bus.append([])
bus.append([])
bus.append([])
row = 0
for i in range(k):
	bus[row].append('O')
	row = (row + 1) % len(bus)
	if i > 4 and row == 2:
		row += 1
if len(bus[2]) == 0:
	bus[2].append('#')
for i in range(11 - len(bus[0])):
	bus[0].append('#')
for i in range(11 - len(bus[1])):
	bus[1].append('#')
for i in range(11 - len(bus[2])):
	bus[2].append('.')
for i in range(11 - len(bus[3])):
	bus[3].append('#')
print('+------------------------+')
print('|' + '.'.join(bus[0]) + '.|D|)')
print('|' + '.'.join(bus[1]) + '.|.|')
print('|' + '.'.join(bus[2]) + '...|')
print('|' + '.'.join(bus[3]) + '.|.|)')
print('+------------------------+')


onibus = [['#', '#', '#', '#'], ['#', '#', '#'], ['#', '#', '#'], ['#', '#', '#'], ['#', '#', '#'], ['#', '#', '#'], ['#', '#', '#'], ['#', '#', '#'], ['#', '#', '#'], ['#', '#', '#'], ['#', '#', '#']]
numero = int(input())
for i in range(numero):
	embora = False
	for k in range(11):
		if '#' in onibus[k]:
			for j in range(len(onibus[k])):
				if onibus[k][j] == '#':
					onibus[k][j] = 'O'
					embora = True
					break
			if embora == True:
				break
print('+------------------------+')
print('|', end='')
for i in range(11):
	print(onibus[i][0], end='')
	print('.', end='')
print('|D|)')
print('|', end='')
for i in range(11):
	print(onibus[i][1], end='')
	print('.', end='')
print('|.|')
print('|', end='')
print(onibus[0][2], end='')
print('.......................|')
print('|', end='')
print(onibus[0][3], end='')
print('.', end='')
for i in range(1, 11):
	print(onibus[i][2], end='')
	print('.', end='')
print('|.|)')
print('+------------------------+')


n = int(input())
print('+------------------------+')
A = [[0 for i in range(11)] for i in range(3)]

def printing():
	global A, s4
	s2 = '|'
	for i in range(11):
		if A[0][i] == 0:
			s2 += '#.'
		else:
			s2 += 'O.'
	s2 += '|D|)'
	print(s2)
	s3 = '|'
	for i in range(11):
		if A[1][i] == 0:
			s3 += '#.'
		else:
			s3 += 'O.'
	s3 += '|.|'
	print(s3)
	print(s4)
	s5 = '|'
	for i in range(11):
		if A[2][i] == 0:
			s5 += '#.'
		else:
			s5 += 'O.'
	s5 += '|.|)'
	print(s5)
if n > 2:
	s4 = '|O.......................|'
	n -= 1
else:
	s4 = '|#.......................|'
for i in range(n):
	A[i % 3][i // 3] = 1
printing()
print('+------------------------+')


import math
n = int(input())
template = ['+------------------------+', '|O.O.O.O.O.O.O.#.#.#.#.|D|)', '|O.O.O.O.O.O.#.#.#.#.#.|.|', '|O.......................|', '|O.O.O.O.O.O.#.#.#.#.#.|.|)', '+------------------------+']
i = 1
listTemplate = []
for s in template:
	listTemplate.append(list(s))
while i <= 34:
	if i > n:
		c = '#'
	else:
		c = 'O'
	if i <= 4:
		row = 0
	else:
		row = math.floor((i - 2) / 3)
	if i <= 4:
		seat = i - 1
	else:
		seat = (i - 5) % 3
	if seat == 2 and row != 0:
		seat += 1
	listTemplate[1 + seat][1 + row * 2] = c
	i += 1
for a in listTemplate:
	print(''.join(a))


def desenhar_linha(linha, ind):
	print('|', end='')
	for i in range(linha):
		print('O.', end='')
	if ind == 1:
		for i in range(11 - linha):
			print('#.', end='')
		print('|', end='')
	else:
		if 11 - linha == 11:
			print('#.', end='')
			linha += 1
		for i in range(11 - linha):
			print('..', end='')
		print('.', end='')
lista = [0, 0, 0, 0]
j = 0
passou = False
k = int(input())
for i in range(k):
	if j == 2 and passou:
		j += 1
	if j == 2:
		passou = True
	lista[j] += 1
	j += 1
	if j == 4:
		j = 0
print('+------------------------+')
desenhar_linha(lista[0], 1)
print('D|)')
desenhar_linha(lista[1], 1)
print('.|')
desenhar_linha(lista[2], 0)
print('.|')
desenhar_linha(lista[3], 1)
print('.|)')
print('+------------------------+')


k = int(input())
bus = '+------------------------+\n|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n+------------------------+'
first1 = 28
first2 = 56
first3 = 83
first4 = 110
line = 1
for i in range(k):
	if line == 1:
		bus = bus[:first1] + 'O' + bus[first1 + 1:]
		first1 += 2
		line = 2
	elif line == 2:
		bus = bus[:first2] + 'O' + bus[first2 + 1:]
		first2 += 2
		if i < 4:
			line = 3
		else:
			line = 4
	elif line == 3:
		bus = bus[:first3] + 'O' + bus[first3 + 1:]
		line = 4
	elif line == 4:
		bus = bus[:first4] + 'O' + bus[first4 + 1:]
		first4 += 2
		line = 1
print(bus)


n = int(input())
a = '+' + '-' * 24 + '+'
print(a)
b = '|'
if n >= 1:
	b = b + 'O.'
else:
	b = b + '#.'
for i in range(1, 11):
	if 3 * i + 2 > n:
		b += '#.'
	else:
		b += 'O.'
b += '|D|)'
print(b)
b = '|'
if n >= 2:
	b = b + 'O.'
else:
	b = b + '#.'
for i in range(1, 11):
	if 3 * i + 3 > n:
		b += '#.'
	else:
		b += 'O.'
b += '|.|'
print(b)
b = '|'
if n >= 3:
	b = b + 'O.'
else:
	b = b + '#.'
b = b + '.' * 22
b += '|'
print(b)
b = '|'
if n >= 4:
	b = b + 'O.'
else:
	b = b + '#.'
for i in range(1, 11):
	if 3 * i + 4 > n:
		b += '#.'
	else:
		b += 'O.'
b += '|.|)'
print(b)
print(a)


n = int(input())
ub = '+------------------------+'
lb = '+------------------------+'
(r1, r2, r3, r4) = (['|'], ['|'], ['|'], ['|'])
fl = 0
if n < 3:
	r3.append('#')
	r3.append('.')
while n != 0:
	r1.append('O')
	r1.append('.')
	n -= 1
	if n == 0:
		break
	r2.append('O')
	r2.append('.')
	n -= 1
	if n == 0:
		break
	if fl != 1:
		r3.append('O')
		r3.append('.')
		n -= 1
		fl = 1
	else:
		r3.append('.')
		r3.append('.')
	if n == 0:
		break
	r4.append('O')
	r4.append('.')
	n -= 1
while len(r1) != 23:
	r1.append('#')
	r1.append('.')
r1.append('|D|)')
while len(r2) != 23:
	r2.append('#')
	r2.append('.')
r2.append('|.|')
while len(r3) != 23:
	r3.append('.')
	r3.append('.')
r3.append('..|')
while len(r4) != 23:
	r4.append('#')
	r4.append('.')
r4.append('|.|)')
print(ub)
print(''.join(r1))
print(''.join(r2))
print(''.join(r3))
print(''.join(r4))
print(lb)


from sys import stdin

def busvacio():
	bus = [[], [], [], [], [], []]
	bus[0].append('+')
	for x in range(24):
		bus[0].append('-')
	bus[0].append('+')
	bus[5].append('+')
	for x in range(24):
		bus[5].append('-')
	bus[5].append('+')
	for x in range(1, 5):
		bus[x].append('|')
	for z in range(1, 3):
		for x in range(11):
			bus[z].append('#')
			bus[z].append('.')
	bus[1].append('|')
	bus[1].append('D')
	bus[1].append('|')
	bus[1].append(')')
	for x in range(11):
		bus[4].append('#')
		bus[4].append('.')
	bus[4].append('|')
	bus[4].append('.')
	bus[4].append('|')
	bus[4].append(')')
	bus[2].append('|')
	bus[2].append('.')
	bus[2].append('|')
	bus[3].append('#')
	for x in range(23):
		bus[3].append('.')
	bus[3].append('|')
	return bus

def rellenar(bus, n):
	if n > 34:
		n = 34
	while n > 0:
		for z in range(1, 22, 2):
			for x in range(1, 5):
				if bus[x][z] == '#' and n > 0:
					bus[x][z] = 'O'
					n -= 1
	return bus

def main():
	n = stdin.readline().strip()
	while len(n) != 0:
		bus = busvacio()
		n = int(n)
		bus = rellenar(bus, n)
		for x in range(6):
			print(''.join(bus[x]))
		n = stdin.readline().strip()
main()


def listToStr(arr):
	res = ''
	for i in arr:
		res += i
	return res

def solve(k):
	border = '+------------------------+'
	row1 = list('|' + '#.' * 11 + '|D|)')
	row2 = list('|' + '#.' * 11 + '|.|')
	row4 = list('|' + '#.' * 11 + '|.|)')
	row3 = list('|#.......................|')
	rem = k
	if rem == 1:
		row1[1] = 'O'
		rem = 0
	if rem == 2:
		row1[1] = 'O'
		row2[1] = 'O'
		rem = 0
	if rem == 3:
		row1[1] = 'O'
		row2[1] = 'O'
		row3[1] = 'O'
		rem = 0
	if rem == 4:
		(row1[1], row2[1], row3[1], row4[1]) = ('O', 'O', 'O', 'O')
		rem = 0
	if rem == 0:
		row1 = listToStr(row1)
		row2 = listToStr(row2)
		row3 = listToStr(row3)
		row4 = listToStr(row4)
		print(border)
		print(row1)
		print(row2)
		print(row3)
		print(row4)
		print(border)
		return
	if rem > 4:
		(row1[1], row2[1], row3[1], row4[1]) = ('O', 'O', 'O', 'O')
		rem -= 4
	rowsPossible = rem // 3
	rem = rem % 3
	pos = 1
	for i in range(1, rowsPossible + 1):
		pos = 2 * i + 1
		row1[pos] = 'O'
		row2[pos] = 'O'
		row4[pos] = 'O'
	pos += 2
	if rem == 1:
		row1[pos] = 'O'
	if rem == 2:
		row1[pos] = 'O'
		row2[pos] = 'O'
	row1 = listToStr(row1)
	row2 = listToStr(row2)
	row3 = listToStr(row3)
	row4 = listToStr(row4)
	print(border)
	print(row1)
	print(row2)
	print(row3)
	print(row4)
	print(border)
	return
k = int(input())
solve(k)


from sys import stdin

def main():
	pasajeros = stdin.readline()
	bus = [['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', 'D', '|', ')'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', '.', '|'], ['|', '#', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '|'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', '.', '|', ')'], ['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+']]
	x = 0
	if int(pasajeros) == 0:
		for i in range(len(bus)):
			for j in range(len(bus[i])):
				print(bus[i][j], end='')
			print()
	else:
		for j in range(1, 25):
			for i in range(1, 5):
				if bus[i][j] == '#' and x <= int(pasajeros) - 1:
					bus[i][j] = 'O'
					x = x + 1
		for i in range(len(bus)):
			for j in range(len(bus[i])):
				print(bus[i][j], end='')
			print()
main()


from sys import stdin

def main():
	n = int(stdin.readline().strip())
	b = [['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', 'D', '|', ')'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', '.', '|'], ['|', '#', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '|'], ['|', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '|', '.', '|', ')'], ['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+']]
	i = 1
	while n > 0:
		j = 0
		while n > 0 and j < 5:
			if b[j][i] == '#':
				b[j][i] = 'O'
				n = n - 1
			j = j + 1
		i = i + 1
	for i in range(len(b)):
		for j in range(len(b[i])):
			print(b[i][j], end='')
		print()
main()


n = int(input())
s = []
s.append(list('+------------------------+'))
s.append(list('|#.#.#.#.#.#.#.#.#.#.#.|D|)'))
s.append(list('|#.#.#.#.#.#.#.#.#.#.#.|.|'))
s.append(list('|#.......................|'))
s.append(list('|#.#.#.#.#.#.#.#.#.#.#.|.|)'))
s.append(list('+------------------------+'))
c = 1
r = 1
for i in range(n):
	s[r][c] = 'O'
	r += 1
	if s[r][c] == '-':
		r = 1
		c += 2
	elif s[r][c] == '.':
		r += 1
for i in range(6):
	S = ''
	for item in s[i]:
		S += item
	print(S)


bus = list(map(list, '+------------------------+\n|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n+------------------------+'.split('\n')))
places = [[1, 1], [2, 1], [3, 1], [4, 1]] + [[1 << y, 1 + 2 * x] for x in range(1, 11) for y in range(3)]
for (x, y) in places[:int(input())]:
	bus[x][y] = 'O'
print(*map(lambda x: ''.join(x), bus), sep='\n')


from collections import Counter
from functools import lru_cache, wraps
from math import gcd
from string import ascii_lowercase
from sys import stderr, stdin, stdout
import time
INF = 10 ** 18 + 3
EPS = 1e-10

def print_to_file(function, file=stderr):

	def wrapped(*args, **kwargs):
		res = function(*args, **kwargs)
		print(res, file=file)
		file.flush()
		return res
	return wrapped

def time_it(function, output=stderr):

	def wrapped(*args, **kwargs):
		start = time.time()
		res = function(*args, **kwargs)
		elapsed_time = time.time() - start
		print('Function "%s" took %f ms' % (function.__name__, elapsed_time * 1000), file=output)
		return res
	return wrapped

@time_it
def main():
	k = int(input())
	text = '+' + '|' * 4 + '+\n'
	text += '-' + 'O' * min(4, k) + '#' * (4 - min(4, k)) + '-\n'
	text += '-' + '.' * 4 + '-\n'
	k -= min(4, k)
	for _ in range(10):
		row = 'O' * min(3, k) + '#' * (3 - min(3, k))
		row = row[:2] + '.' + row[2:]
		text += '-' + row + '-\n'
		text += '-' + '.' * 4 + '-\n'
		k -= min(3, k)
	text += '-||.|-\n'
	text += '-D...-\n'
	text += '+' + '|' * 4 + '+'
	text = [''.join(el) for el in zip(*text.split('\n'))]
	text[1] += ')'
	text[4] += ')'
	for line in text:
		print(line)

@print_to_file
def range_of_len(start, length, step=1):
	return range(start, start + length * step, step)

def set_input(file):
	global input
	input = lambda : file.readline().strip()

def set_output(file):
	global print
	l_print = print

	def print(*args, **kwargs):
		kwargs['file'] = kwargs.get('file', file)
		return l_print(*args, **kwargs)
main()


K = int(input())
Bus = [[('+', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('+', 0)], [('|', 0), ('S', 1), ('.', 0), ('S', 5), ('.', 0), ('S', 8), ('.', 0), ('S', 11), ('.', 0), ('S', 14), ('.', 0), ('S', 17), ('.', 0), ('S', 20), ('.', 0), ('S', 23), ('.', 0), ('S', 26), ('.', 0), ('S', 29), ('.', 0), ('S', 32), ('.', 0), ('|', 0), ('D', 0), ('|', 0), (')', 0)], [('|', 0), ('S', 2), ('.', 0), ('S', 6), ('.', 0), ('S', 9), ('.', 0), ('S', 12), ('.', 0), ('S', 15), ('.', 0), ('S', 18), ('.', 0), ('S', 21), ('.', 0), ('S', 24), ('.', 0), ('S', 27), ('.', 0), ('S', 30), ('.', 0), ('S', 33), ('.', 0), ('|', 0), ('.', 0), ('|', 0)], [('|', 0), ('S', 3), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('.', 0), ('|', 0)], [('|', 0), ('S', 4), ('.', 0), ('S', 7), ('.', 0), ('S', 10), ('.', 0), ('S', 13), ('.', 0), ('S', 16), ('.', 0), ('S', 19), ('.', 0), ('S', 22), ('.', 0), ('S', 25), ('.', 0), ('S', 28), ('.', 0), ('S', 31), ('.', 0), ('S', 34), ('.', 0), ('|', 0), ('.', 0), ('|', 0), (')', 0)], [('+', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('-', 0), ('+', 0)]]
for i in range(0, len(Bus)):
	line = ''
	for j in range(0, len(Bus[i])):
		(char, number) = Bus[i][j]
		if char == 'S':
			if number <= K:
				line += 'O'
			else:
				line += '#'
		else:
			line += char
	print(line)


import re
import inspect
from sys import argv, exit

def rstr():
	return input()

def rint():
	return int(input())

def rints(splitchar=' '):
	return [int(i) for i in input().split(splitchar)]

def varnames(obj, namespace=globals()):
	return [name for name in namespace if namespace[name] is obj]

def pvar(var, override=False):
	prnt(varnames(var), var)

def prnt(*args, override=False):
	if '-v' in argv or override:
		print(*args)
n = rint()
side = '+------------------------+ '
r1 = '|S.S.S.S.S.S.S.S.S.S.S.|D|)'
r2 = '|S.S.S.S.S.S.S.S.S.S.S.|.| '
r3 = '|S.......................| '
r4 = '|S.S.S.S.S.S.S.S.S.S.S.|.|)'
cols = list([list(a) for a in zip(side, r1, r2, r3, r4, side)])
for (r, row) in enumerate(cols):
	for (c, col) in enumerate(row):
		if cols[r][c] == 'S':
			cols[r][c] = '#'
			n -= 1
			if n == 0:
				break
	if n == 0:
		break
rows = list([''.join(c) for c in zip(*cols)])
rows = [r.replace('S', '!') for r in rows]
rows = [r.replace('#', 'O') for r in rows]
rows = [r.replace('!', '#') for r in rows]
for r in rows:
	print(r.strip(' '))


def populate_bus(num_participants):
	bus_2d_arr = [['#'] * 11, ['#'] * 11, ['#'] * 11, ['#'] * 11]
	n = num_participants
	row_2_used = False
	for col in range(11):
		for row in range(4):
			if n == 0:
				return print_bus(bus_2d_arr)
			elif row == 2 and row_2_used == False:
				row_2_used = True
				bus_2d_arr[row][col] = 'O'
				n -= 1
			else:
				bus_2d_arr[row][col] = 'O'
				if row != 2:
					n -= 1
	return print_bus(bus_2d_arr)

def print_bus(seat_array):
	print('+------------------------+')
	print('|', end='')
	for i in range(11):
		print(seat_array[0][i] + '.', end='')
	print('|D|)')
	print('|', end='')
	for i in range(11):
		print(seat_array[1][i] + '.', end='')
	print('|.|')
	print('|', end='')
	print(seat_array[2][0] + '.......................|')
	print('|', end='')
	for i in range(11):
		print(seat_array[3][i] + '.', end='')
	print('|.|)')
	print('+------------------------+')
participants = int(input())
populate_bus(participants)


bus = ['+------------------------+', '|#.#.#.#.#.#.#.#.#.#.#.|D|)', '|#.#.#.#.#.#.#.#.#.#.#.|.|', '|#.......................|', '|#.#.#.#.#.#.#.#.#.#.#.|.|)', '+------------------------+']
p = int(input())
i = 0
while p:
	if '#' in bus[i]:
		bus[i] = bus[i].replace('#', 'O', 1)
		p -= 1
	i = (i + 1) % len(bus)
for l in bus:
	print(l)


y = int(input(''))
wa = '+------------------------+'
wb = '|#.#.#.#.#.#.#.#.#.#.#.|D|)'
wc = '|#.#.#.#.#.#.#.#.#.#.#.|.|'
wd = '|#.......................|'
we = '|#.#.#.#.#.#.#.#.#.#.#.|.|)'
wf = '+------------------------+'
a = list(wa)
b = list(wb)
c = list(wc)
d = list(wd)
e = list(we)
f = list(wf)
current = 1
index = 1
if y >= 3:
	d[1] = 'O'
value = 1
while value <= y:
	if current == 1:
		b[index] = 'O'
		current = current + 1
		value = value + 1
		if y == 1:
			break
		if value == y and y != 2:
			break
	if current == 2:
		c[index] = 'O'
		current = current + 2
		value = value + 1
		if y == 2:
			break
		if value == y:
			break
	if current == 4:
		e[index] = 'O'
		current = 1
		index = index + 2
		value = value + 1
		if value == y:
			break

def mS(listy):
	returnString = ''
	for value in listy:
		returnString = returnString + value
	return returnString
print(mS(a))
print(mS(b))
print(mS(c))
print(mS(d))
print(mS(e))
print(mS(f))


bus = ['+------------------------+', '|#.#.#.#.#.#.#.#.#.#.#.|D|)', '|#.#.#.#.#.#.#.#.#.#.#.|.|', '|#.......................|', '|#.#.#.#.#.#.#.#.#.#.#.|.|)', '+------------------------+']
bus = '+||||+\n-{}{}{}{}-\n-....-\n-{}{}.{}-\n-....-\n-{}{}.{}-\n-....-\n-{}{}.{}-\n-....-\n-{}{}.{}-\n-....-\n-{}{}.{}-\n-....-\n-{}{}.{}-\n-....-\n-{}{}.{}-\n-....-\n-{}{}.{}-\n-....-\n-{}{}.{}-\n-....-\n-{}{}.{}-\n-....-\n-||.|-\n-D...-\n+||||+\n )  ) '
n = int(input())
bus = bus.format(*['O'] * n + ['#'] * (34 - n))
bus = '\n'.join((''.join(k).strip() for k in zip(*bus.splitlines())))
print(bus)


k = int(input())
s = [list('+------------------------+'), list('|#.#.#.#.#.#.#.#.#.#.#.|D|)'), list('|#.#.#.#.#.#.#.#.#.#.#.|.|'), list('|#.......................|'), list('|#.#.#.#.#.#.#.#.#.#.#.|.|)'), list('+------------------------+')]
row = 1
c = 1
for i in range(k):
	s[c][row] = 'O'
	c += 1
	if row > 1 and c == 3:
		c += 1
	if c == 5:
		c = 1
		row += 2
for i in range(6):
	print(''.join([ss for ss in s[i]]))


bus = [list('+------------------------+'), list('|#.#.#.#.#.#.#.#.#.#.#.|D|)'), list('|#.#.#.#.#.#.#.#.#.#.#.|.|'), list('|#.......................|'), list('|#.#.#.#.#.#.#.#.#.#.#.|.|)'), list('+------------------------+')]
n = int(input())
for i in range(n):
	ok = False
	for r in range(11):
		if ok:
			break
		r_num = 2 * r + 1
		for j in range(1, 5):
			if ok:
				break
			if bus[j][r_num] == '#':
				bus[j][r_num] = 'O'
				ok = True
for s in bus:
	print(''.join(s))


class CodeforcesTask475ASolution:

	def __init__(self):
		self.result = ''
		self.passengers = 0

	def read_input(self):
		self.passengers = int(input())

	def process_task(self):
		seats = ['#' for x in range(34)]
		for x in range(self.passengers):
			seats[x] = 'O'
		bus = '+------------------------+\n|{0}.{4}.{7}.{10}.{13}.{16}.{19}.{22}.{25}.{28}.{31}.|D|)\n|{1}.{5}.{8}.{11}.{14}.{17}.{20}.{23}.{26}.{29}.{32}.|.|\n|{2}.......................|\n|{3}.{6}.{9}.{12}.{15}.{18}.{21}.{24}.{27}.{30}.{33}.|.|)\n+------------------------+'.format(*seats)
		self.result = bus

	def get_result(self):
		return self.result
Solution = CodeforcesTask475ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


k = int(input())
print('+------------------------+')
s = 1
kc = k
sh = 1
while s <= 4:
	sh = 1
	print('|', end='')
	if s == 1:
		while sh <= 12:
			if sh != 12:
				if k > 0:
					print('O.', end='')
					if k == kc:
						k -= 4
					else:
						k -= 3
				else:
					print('#.', end='')
			else:
				print('|D|)')
				s += 1
				k = kc
			sh += 1
	if s == 2:
		while sh <= 12:
			if sh != 12:
				if k >= 2:
					print('O.', end='')
					if k == kc:
						k -= 4
					else:
						k -= 3
				else:
					print('#.', end='')
			else:
				print('|.|')
				k = kc
				s += 1
			sh += 1
	if s == 3:
		while sh <= 12:
			if sh != 12:
				if k >= 3:
					print('O.', end='')
					k = 0
				elif sh == 1:
					print('#.', end='')
				else:
					print('..', end='')
			else:
				print('..|')
				s += 1
				k = kc
			sh += 1
	if s == 4:
		while sh <= 12:
			if sh != 12:
				if sh != 1:
					if k >= 3:
						print('O.', end='')
					else:
						print('#.', end='')
					k -= 3
				if sh == 1:
					if k >= 4:
						print('O.', end='')
					else:
						print('#.', end='')
					k -= 4
			else:
				print('|.|)')
				k = kc
				s += 1
			sh += 1
print('+------------------------+')


__author__ = 'hamed1soleimani'
lines = list()
lines.append('+------------------------+')
lines.append('|#.#.#.#.#.#.#.#.#.#.#.|D|)')
lines.append('|#.#.#.#.#.#.#.#.#.#.#.|.|')
lines.append('|#.......................|')
lines.append('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
lines.append('+------------------------+')
n = int(input())
while True:
	if n == 0:
		break
	idx = list()
	for m in range(1, 5):
		idx.append(lines[m].find('#'))
	while True:
		if idx.count(-1) > 0:
			idx.remove(-1)
		else:
			break
	x = min(idx)
	if lines[1].find('#') == x:
		lines[1] = lines[1].replace('#', 'O', 1)
		n -= 1
	elif lines[2].find('#') == x:
		lines[2] = lines[2].replace('#', 'O', 1)
		n -= 1
	elif lines[3].find('#') == x:
		lines[3] = lines[3].replace('#', 'O', 1)
		n -= 1
	elif lines[4].find('#') == x:
		lines[4] = lines[4].replace('#', 'O', 1)
		n -= 1
for ss in lines:
	print(ss)


n = int(input())
bus = list('####' + '##.#' * 10)
count = 0
for i in range(44):
	if count == n:
		break
	if bus[i] != '.':
		bus[i] = 'O'
		count += 1
print('+------------------------+')
print('|' + '.'.join(bus[0::4]) + '.|D|)')
print('|' + '.'.join(bus[1::4]) + '.|.|')
print('|' + '.'.join(bus[2::4]) + '...|')
print('|' + '.'.join(bus[3::4]) + '.|.|)')
print('+------------------------+')


n = int(input())
row = ['|', '|', '|', '|']
c = 0
for i in range(1, 45):
	if c > 3:
		c = 0
	if i < 4:
		if n < 1:
			row[c] += '#.'
		else:
			row[c] += 'O.'
	elif c == 2:
		row[c] += '..'
		n += 1
	elif n < 1:
		row[c] += '#.'
	elif n > 0:
		row[c] += 'O.'
	c += 1
	n -= 1
row[0] += '|D|)'
row[1] += '|.|'
row[2] += '..|'
row[3] += '|.|)'
print('+------------------------+')
print(row[0])
print(row[1])
print(row[2])
print(row[3])
print('+------------------------+')


riders = int(input())
fill = (0, 0, 0, 0)
if riders == 1:
	fill = (1, 0, 0, 0)
if riders == 2:
	fill = (1, 1, 0, 0)
if riders == 3:
	fill = (1, 1, 1, 0)
if riders == 4:
	fill = (1, 1, 1, 1)
if riders >= 5:
	new = riders - 1
	even = int(new / 3)
	if new % 3 == 0:
		fill = (even, even, 1, even)
	elif new % 3 == 1:
		fill = (even + 1, even, 1, even)
	else:
		fill = (even + 1, even + 1, 1, even)
print('+------------------------+')
print('|' + 'O.' * fill[0] + '#.' * (11 - fill[0]) + '|D|)')
print('|' + 'O.' * fill[1] + '#.' * (11 - fill[1]) + '|.|')
print('|' + '#' * (1 - fill[2]) + 'O' * fill[2] + '.......................|')
print('|' + 'O.' * fill[3] + '#.' * (11 - fill[3]) + '|.|)')
print('+------------------------+')


x = int(input())
if 0 <= x <= 34:
	y = 0
	pos = ['#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#']
	while x > 0:
		pos[y] = 'O'
		x -= 1
		y += 1
	print('+------------------------+')
	print('|' + str(pos[0]) + '.' + str(pos[4]) + '.' + str(pos[7]) + '.' + str(pos[10]) + '.' + str(pos[13]) + '.' + str(pos[16]) + '.' + str(pos[19]) + '.' + str(pos[22]) + '.' + str(pos[25]) + '.' + str(pos[28]) + '.' + str(pos[31]) + '.' + '|D|)')
	print('|' + str(pos[1]) + '.' + str(pos[5]) + '.' + str(pos[8]) + '.' + str(pos[11]) + '.' + str(pos[14]) + '.' + str(pos[17]) + '.' + str(pos[20]) + '.' + str(pos[23]) + '.' + str(pos[26]) + '.' + str(pos[29]) + '.' + str(pos[32]) + '.|.|')
	print('|' + str(pos[2]) + '.......................|')
	print('|' + str(pos[3]) + '.' + str(pos[6]) + '.' + str(pos[9]) + '.' + str(pos[12]) + '.' + str(pos[15]) + '.' + str(pos[18]) + '.' + str(pos[21]) + '.' + str(pos[24]) + '.' + str(pos[27]) + '.' + str(pos[30]) + '.' + str(pos[33]) + '.|.|)')
	print('+------------------------+')


numberOfparticipants = int(input())
participants = ['foo'] * numberOfparticipants
firstLine = []
secondLine = []
thirdLine = []
fourthLine = []
for k in range(0, 11):
	for l in range(0, 4):
		if l == 0 and len(participants) > 0:
			firstLine.append('O')
			participants.pop(0)
		elif l == 1 and len(participants) > 0:
			secondLine.append('O')
			participants.pop(0)
		elif k == 0 and l == 2 and (len(participants) > 0):
			thirdLine.append('O')
			participants.pop(0)
		elif l == 3 and len(participants) > 0:
			fourthLine.append('O')
			participants.pop(0)
print('+------------------------+')
for i in range(0, 4):
	for j in range(0, 27):
		if j == 0 or (j == 23 and i != 2) or j == 25:
			print('|', end='')
		elif j == 26 and (i == 0 or i == 3):
			print(')', end='')
		elif j == 26 and (i == 1 or i == 2):
			print('', end='')
		elif j == 24 and i == 0:
			print('D', end='')
		elif j % 2 == 0 or (j > 1 and i == 2):
			print('.', end='')
		elif i == 0 and len(firstLine):
			print(firstLine.pop(), end='')
		elif i == 1 and len(secondLine):
			print(secondLine.pop(), end='')
		elif i == 2 and len(thirdLine):
			print(thirdLine.pop(), end='')
		elif i == 3 and len(fourthLine):
			print(fourthLine.pop(), end='')
		else:
			print('#', end='')
	print('')
print('+------------------------+')


i = int(input())
rows = {1: 0, 2: 0, 3: 0, 4: 0}
thirdFull = False
if i > 4:
	for n in range(1, 5):
		rows[n] += 1
	count = 1
	for n in range(4, i):
		if count is 3:
			count = 1
			rows[4] += 1
		elif count is 2:
			count += 1
			rows[2] += 1
		else:
			count += 1
			rows[1] += 1
else:
	for n in range(1, i + 1):
		rows[n] += 1
firstThree = True
st = '+------------------------+\n'
for n in range(1, 5):
	st += '|'
	for j in range(11):
		if rows[n] > j:
			st += 'O'
			if n is 3 and firstThree is True:
				firstThree = False
		elif n is 3:
			if firstThree:
				st += '#'
				firstThree = False
			else:
				st += '.'
		else:
			st += '#'
		st += '.'
	if n is 1:
		st += '|D|)'
	elif n is 3:
		st += '..|'
	elif n is 4:
		st += '|.|)'
	else:
		st += '|.|'
	st += '\n'
st += '+------------------------+'
print(st)


N = int(input())
lista = []
correder = '#'
if N > 2:
	N -= 1
	correder = 'O'
for i in range(N):
	lista.append('O')
for i in range(34 - N):
	lista.append('#')
corredores = ['', '', '']
colunas_cheias = int(N / 3)
colunas_imcompleta = N % 3
for i in range(3):
	corredores[i] += 'O' * colunas_cheias
for i in range(colunas_imcompleta):
	corredores[i] += 'O'
for i in range(3):
	if len(corredores[i]) < 11:
		corredores[i] += '#' * (11 - len(corredores[i]))
print('+------------------------+')
print('|', end='')
print(*corredores[0], sep='.', end='')
print('.|D|)')
print('|', end='')
print(*corredores[1], sep='.', end='')
print('.|.|')
print('|', end='')
print(correder + '.' * 20, end='')
print('...|')
print('|', end='')
print(*corredores[2], sep='.', end='')
print('.|.|)')
print('+------------------------+')


def replaceString(s, newstring, index):
	return s[:index] + newstring + s[index + 1:]

def main():
	n = int(input())
	busMap = []
	sideBus = '+------------------------+'
	seats = '#.#.#.#.#.#.#.#.#.#.#.'
	center = '#.....................'
	busMap.append(seats)
	busMap.append(seats)
	busMap.append(center)
	busMap.append(seats)
	for i in range(22):
		for j in range(4):
			if n > 0 and busMap[j][i] == '#':
				busMap[j] = replaceString(busMap[j], 'O', i)
				n -= 1
	print(sideBus)
	print('|' + busMap[0] + '|D|)')
	print('|' + busMap[1] + '|.|')
	print('|' + busMap[2] + '..|')
	print('|' + busMap[3] + '|.|)')
	print(sideBus)
main()


class Row:

	@classmethod
	def createDottedRow(cls):
		r = cls(islast=False)
		for x in range(3):
			r.append('.')
		return r

	def __init__(self, islast):
		self._isLast = islast
		self.isFull = False
		self.rowContent = []

	def append(self, char='O'):
		l = len(self.rowContent)
		assert len(self.rowContent) < 4
		if l == 2 and self._isLast is False:
			self.rowContent.append('.')
		self.rowContent.append(char)
		if len(self.rowContent) == 4:
			self.isFull = True

	def __str__(self):
		assert len(self.rowContent) <= 4
		tmp = ''.join(self.rowContent)
		result = tmp.ljust(4, '#')
		if self._isLast is False and result[2] == '#':
			return result[:2] + '.' + result[-1]
		return result

class Matrix:

	def __init__(self):
		r = Row.createDottedRow()
		self.matrixContent = []
		self.currentRow = None
		self.firstTime = True
		self._len = 0

	def append(self, char='O'):
		self._len += 1
		if self.firstTime is True:
			r = Row(islast=True)
			r.append(char)
			self.matrixContent.append(r)
			self.firstTime = False
			return
		r = self.matrixContent[-1]
		if r.isFull is True:
			tmp = Row(islast=False)
			self.matrixContent.append(Row.createDottedRow())
			self.matrixContent.append(tmp)
			tmp.append(char)
			return
		r.append(char)

	def fill(self):
		amount = 34 - len(self)
		for x in range(amount):
			self.append('#')

	def __len__(self):
		return self._len
bus = Matrix()
amount = int(input())
for x in range(amount):
	bus.append()
bus.fill()
mat = list((str(row) for row in bus.matrixContent))
l = list(zip(*mat))
endlines = {0: '.|D|)\n', 1: '.|.|\n', 2: '...|\n', 3: '.|.|)\n'}

def result():
	i = 0
	for row in l:
		yield '|'
		for point in row:
			yield point
		yield endlines[i]
		i += 1
s = '+------------------------+\n' + ''.join(result()) + '+------------------------+'
print(s)


__author__ = 'Aleksey'
k = int(input())
mas = []
for i in range(34):
	if k > i:
		mas.append('O')
	else:
		mas.append('#')
res_str = '+------------------------+\n|{0}.{4}.{7}.{10}.{13}.{16}.{19}.{22}.{25}.{28}.{31}.|D|)\n|{1}.{5}.{8}.{11}.{14}.{17}.{20}.{23}.{26}.{29}.{32}.|.|\n|{2}.......................|\n|{3}.{6}.{9}.{12}.{15}.{18}.{21}.{24}.{27}.{30}.{33}.|.|)\n+------------------------+'
print(res_str.format(*mas))


def print_bus(line):
	print('|', end='')
	for i in range(len(line)):
		print(line[i], end='')
		if i != len(line) - 1:
			print('.', end='')
	print()
k = int(input())
line1 = ['#'] * 11
line2 = ['#'] * 11
line3 = ['#'] * 11
line4 = ['#'] * 11
p = 0
r = 0
c = 0
while p < k:
	if p < 4:
		if r == 0:
			line1[c] = 'O'
		elif r == 1:
			line2[c] = 'O'
		elif r == 2:
			line3[c] = 'O'
		else:
			line4[c] = 'O'
		r += 1
		if r == 4:
			r = 0
			c += 1
	else:
		if r == 0:
			line1[c] = 'O'
		elif r == 1:
			line2[c] = 'O'
		else:
			line3[c] = '.'
			line4[c] = 'O'
		r += 1
		if r == 3:
			r = 0
			c += 1
	p += 1
if c > 0:
	for i in range(c, 11):
		line3[i] = '.'
else:
	for i in range(c + 1, 11):
		line3[i] = '.'
line1.append('|D|)')
line2.append('|.|')
line3.append('..|')
line4.append('|.|)')
print('+------------------------+')
print_bus(line1)
print_bus(line2)
print_bus(line3)
print_bus(line4)
print('+------------------------+')


n = int(input())
seat = [['#', '#', '#', '#'] for x in range(11)]
for i in range(11):
	for j in range(4):
		if i != 0 and j == 2:
			seat[i][j] = '.'
		elif n > 0:
			n = n - 1
			seat[i][j] = 'O'
seat = list(map(list, zip(*seat)))
print('+------------------------+')
for i in range(4):
	print('|', end='')
	for j in range(11):
		print(seat[i][j] + '.', end='')
	if i == 0:
		print('|D|)')
	elif i == 1:
		print('|.|')
	elif i == 2:
		print('..|')
	elif i == 3:
		print('|.|)')
print('+------------------------+')


temp = input()
n = int(temp)
um = []
dois = []
tres = []
quatro = []
cinco = []
seis = []
for i in range(0, 27):
	if i > 0 and i < 22 and (i % 2 == 0):
		um.append('-')
		dois.append('.')
		tres.append('.')
		quatro.append('.')
		cinco.append('.')
		seis.append('-')
	if i == 1:
		um.append('-')
		dois.append('#')
		tres.append('#')
		quatro.append('#')
		cinco.append('#')
		seis.append('-')
	if i > 1 and i < 22 and (i % 2 != 0):
		um.append('-')
		dois.append('#')
		tres.append('#')
		quatro.append('.')
		cinco.append('#')
		seis.append('-')
	if i == 0 or i == 25:
		um.append('+')
		dois.append('|')
		tres.append('|')
		quatro.append('|')
		cinco.append('|')
		seis.append('+')
	if i == 22:
		um.append('-')
		dois.append('.')
		tres.append('.')
		quatro.append('.')
		cinco.append('.')
		seis.append('-')
	if i == 23:
		um.append('-')
		dois.append('|')
		tres.append('|')
		quatro.append('.')
		cinco.append('|')
		seis.append('-')
	if i == 24:
		um.append('-')
		dois.append('D')
		tres.append('.')
		quatro.append('.')
		cinco.append('.')
		seis.append('-')
	if i == 26:
		dois.append(')')
		cinco.append(')')
flag = 0
flag1 = 1
flag2 = 1
vamo = 3
for k in range(0, n):
	if k == 0:
		dois[1] = 'O'
	if k == 1:
		tres[1] = 'O'
	if k == 2:
		quatro[1] = 'O'
	if k == 3:
		cinco[1] = 'O'
	if k > 3:
		if flag == 0:
			dois[vamo] = 'O'
			flag = 1
			flag1 = 0
			flag2 = 1
		elif flag1 == 0:
			tres[vamo] = 'O'
			flag = 1
			flag1 = 1
			flag2 = 0
		elif flag2 == 0:
			cinco[vamo] = 'O'
			flag = 0
			flag1 = 1
			flag2 = 1
			vamo = vamo + 2
print(''.join(um))
print(''.join(dois))
print(''.join(tres))
print(''.join(quatro))
print(''.join(cinco))
print(''.join(seis))


bus = '+------------------------+\n|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n+------------------------+'
bus = [list(line) for line in bus.split()]
n = int(input())
for i in range(4):
	if n <= 0:
		break
	bus[i + 1][1] = 'O'
	n -= 1
row = 1
col = 3
while n > 0:
	bus[row][col] = 'O'
	n -= 1
	row = 2 * row
	if row > 4:
		row = 1
		col += 2
print('\n'.join([''.join(line) for line in bus]))


n = int(input())
L = ['+------------------------+', '|#.#.#.#.#.#.#.#.#.#.#.|D|)', '|#.#.#.#.#.#.#.#.#.#.#.|.|', '|#.......................|', '|#.#.#.#.#.#.#.#.#.#.#.|.|)', '+------------------------+']
L = [[x for x in y] for y in L]
for i in range(len(L[0])):
	for j in range(len(L)):
		if L[j][i] == '#' and n > 0:
			n -= 1
			L[j][i] = 'O'
for x in L:
	print(''.join(x))


def main():
	n = int(input())
	if n == 0:
		print('+------------------------+')
		print('|#.#.#.#.#.#.#.#.#.#.#.|D|)')
		print('|#.#.#.#.#.#.#.#.#.#.#.|.|')
		print('|#.......................|')
		print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 1:
		print('+------------------------+')
		print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
		print('|#.#.#.#.#.#.#.#.#.#.#.|.|')
		print('|#.......................|')
		print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 2:
		print('+------------------------+')
		print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
		print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
		print('|#.......................|')
		print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 3:
		print('+------------------------+')
		print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
		print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 4:
		print('+------------------------+')
		print('|O.#.#.#.#.#.#.#.#.#.#.|D|)')
		print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.#.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 5:
		print('+------------------------+')
		print('|O.O.#.#.#.#.#.#.#.#.#.|D|)')
		print('|O.#.#.#.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.#.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 6:
		print('+------------------------+')
		print('|O.O.#.#.#.#.#.#.#.#.#.|D|)')
		print('|O.O.#.#.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.#.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 7:
		print('+------------------------+')
		print('|O.O.#.#.#.#.#.#.#.#.#.|D|)')
		print('|O.O.#.#.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 8:
		print('+------------------------+')
		print('|O.O.O.#.#.#.#.#.#.#.#.|D|)')
		print('|O.O.#.#.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 9:
		print('+------------------------+')
		print('|O.O.O.#.#.#.#.#.#.#.#.|D|)')
		print('|O.O.O.#.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.#.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 10:
		print('+------------------------+')
		print('|O.O.O.#.#.#.#.#.#.#.#.|D|)')
		print('|O.O.O.#.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 11:
		print('+------------------------+')
		print('|O.O.O.O.#.#.#.#.#.#.#.|D|)')
		print('|O.O.O.#.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 12:
		print('+------------------------+')
		print('|O.O.O.O.#.#.#.#.#.#.#.|D|)')
		print('|O.O.O.O.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.#.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 13:
		print('+------------------------+')
		print('|O.O.O.O.#.#.#.#.#.#.#.|D|)')
		print('|O.O.O.O.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 14:
		print('+------------------------+')
		print('|O.O.O.O.O.#.#.#.#.#.#.|D|)')
		print('|O.O.O.O.#.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 15:
		print('+------------------------+')
		print('|O.O.O.O.O.#.#.#.#.#.#.|D|)')
		print('|O.O.O.O.O.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.#.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 16:
		print('+------------------------+')
		print('|O.O.O.O.O.#.#.#.#.#.#.|D|)')
		print('|O.O.O.O.O.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 17:
		print('+------------------------+')
		print('|O.O.O.O.O.O.#.#.#.#.#.|D|)')
		print('|O.O.O.O.O.#.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 18:
		print('+------------------------+')
		print('|O.O.O.O.O.O.#.#.#.#.#.|D|)')
		print('|O.O.O.O.O.O.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.#.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 19:
		print('+------------------------+')
		print('|O.O.O.O.O.O.#.#.#.#.#.|D|)')
		print('|O.O.O.O.O.O.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 20:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.#.#.#.#.|D|)')
		print('|O.O.O.O.O.O.#.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 21:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.#.#.#.#.|D|)')
		print('|O.O.O.O.O.O.O.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.#.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 22:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.#.#.#.#.|D|)')
		print('|O.O.O.O.O.O.O.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 23:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.#.#.#.|D|)')
		print('|O.O.O.O.O.O.O.#.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 24:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.#.#.#.|D|)')
		print('|O.O.O.O.O.O.O.O.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.#.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 25:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.#.#.#.|D|)')
		print('|O.O.O.O.O.O.O.O.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 26:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.O.#.#.|D|)')
		print('|O.O.O.O.O.O.O.O.#.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 27:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.O.#.#.|D|)')
		print('|O.O.O.O.O.O.O.O.O.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.#.#.#.|.|)')
		print('+------------------------+')
	elif n == 28:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.O.#.#.|D|)')
		print('|O.O.O.O.O.O.O.O.O.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.O.#.#.|.|)')
		print('+------------------------+')
	elif n == 29:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.O.O.#.|D|)')
		print('|O.O.O.O.O.O.O.O.O.#.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.O.#.#.|.|)')
		print('+------------------------+')
	elif n == 30:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.O.O.#.|D|)')
		print('|O.O.O.O.O.O.O.O.O.O.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.O.#.#.|.|)')
		print('+------------------------+')
	elif n == 31:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.O.O.#.|D|)')
		print('|O.O.O.O.O.O.O.O.O.O.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.O.O.#.|.|)')
		print('+------------------------+')
	elif n == 32:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.O.O.O.|D|)')
		print('|O.O.O.O.O.O.O.O.O.O.#.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.O.O.#.|.|)')
		print('+------------------------+')
	elif n == 33:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.O.O.O.|D|)')
		print('|O.O.O.O.O.O.O.O.O.O.O.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.O.O.#.|.|)')
		print('+------------------------+')
	elif n == 34:
		print('+------------------------+')
		print('|O.O.O.O.O.O.O.O.O.O.O.|D|)')
		print('|O.O.O.O.O.O.O.O.O.O.O.|.|')
		print('|O.......................|')
		print('|O.O.O.O.O.O.O.O.O.O.O.|.|)')
		print('+------------------------+')
main()


a = []
a.append('+------------------------+')
a.append('|#.#.#.#.#.#.#.#.#.#.#.|D|)')
a.append('|#.#.#.#.#.#.#.#.#.#.#.|.|')
a.append('|#.......................|')
a.append('|#.#.#.#.#.#.#.#.#.#.#.|.|)')
a.append('+------------------------+')
a = list(map(list, a))
curr = [0, 0]
n = int(input())
while n > 0:
	if a[curr[0]][curr[1]] == '#':
		a[curr[0]][curr[1]] = 'O'
		n -= 1
	curr[0] += 1
	if curr[0] >= 6:
		curr[0] = 0
		curr[1] += 1
for i in range(5):
	for j in a[i][:-1]:
		print(j, end='')
	print(a[i][-1])
for j in a[5]:
	print(j, end='')