def do_twice(f):
f()
f()
def do_four(f):
do_twice(f)
do_twice(f)
def print_beam():
print('+ - - - -')
def print_post():
print('| ')
def print_beams():
do_twice(print_beam)
print('+')
def print_posts():
do_twice(print_post)
print('|')
def print_row():
print_beams()
do_four(print_posts)
def print_grid():
do_twice(print_row)
print_beams()
print_grid()
ZGVmIGRvX3R3aWNlKGYpOgogICAgZigpCiAgICBmKCkKCmRlZiBkb19mb3VyKGYpOgogICAgZG9fdHdpY2UoZikKICAgIGRvX3R3aWNlKGYpCgpkZWYgcHJpbnRfYmVhbSgpOgogICAgcHJpbnQoJysgLSAtIC0gLScpCgpkZWYgcHJpbnRfcG9zdCgpOgogICAgcHJpbnQoJ3wgICAgICAgICcpCgpkZWYgcHJpbnRfYmVhbXMoKToKICAgIGRvX3R3aWNlKHByaW50X2JlYW0pCiAgICBwcmludCgnKycpCgpkZWYgcHJpbnRfcG9zdHMoKToKICAgIGRvX3R3aWNlKHByaW50X3Bvc3QpCiAgICBwcmludCgnfCcpCgpkZWYgcHJpbnRfcm93KCk6CiAgICBwcmludF9iZWFtcygpCiAgICBkb19mb3VyKHByaW50X3Bvc3RzKQoKZGVmIHByaW50X2dyaWQoKToKICAgIGRvX3R3aWNlKHByaW50X3JvdykKICAgIHByaW50X2JlYW1zKCkKCnByaW50X2dyaWQoKQ==