Q=[]
A=->*x{Q<<[?+,*x]*" "}
C=->*x{Q<<[?<,*x]*" "}

C[3,0,3]
0.upto(30){|i|
 A[3+i,3+i,4+i]
}

def to_b(x,s)
 A[x,3,x]
 31.downto(0){|i|
  A[3+i,s+33,s+32]
  C[s+32,x,s+i]
  A[s+i,2,s+32]
  i.times{A[s+32,s+32,s+32]}
  A[s+32,s+33,s+33]
 }
end

to_b(0,67)
to_b(1,195)

30.times{|i|
 30.times{|j|
  A[67+i,195+j,324]
  C[3,324,325]
  A[326+i+j,325,326+i+j]
 }
}

60.times{|i|
 i.times{A[326+i,326+i,326+i]}
 A[2,326+i,2]
}

puts Q.size,Q