r=?D z=(3..2*x=2**gets.to_i.times{r.gsub!(/\w/){$&<?H?'-H|+D|D+|H-':'+D|-H|H-|D+'}}).map{' '*2*x} y=d=0 r.bytes{|c|c>99?(z[y-=s=-~d/2%2][x-=1-d/2]='/\\'[d%2] x+=d/2 y+=1-s):d=3&d-c} puts z.map &:rstrip
3
\ /\/ / /\ \/\ \ \ /\ / / / / / \/ \/\ \ \/\ /\ \ \/ / / / /\/ /\/ / \ \ \ \/\ \/ \/\ \ / /\/ \ \ \/