W=raw_input().split() for s in" _____","| "*3,"| | ","|_|__|":print s[:2]+s[1:4].join((s[4:]*9+w)[:len(w)]for w in W)+s[1::-1].rstrip()