A = [3,5]
Q = []

def a(x,y,z)
 Q << [?+,x,y,z]*" "
 A[z] = (A[x]||=0) + (A[y]||=0)
end

def c(x,y,z)
 Q << [?<,x,y,z]*" "
 A[z] = (A[x]||=0) < (A[y]||=0) ? 1 : 0
end

c(3,0,3)
31.times{|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+32+i+1,s+32+i)
  c(s+32+i,x,s+i)
  a(s+i,2,s+32+i)
  i.times{a(s+32+i,s+32+i,s+32+i)}
  a(s+32+i,s+32+i+1,s+32+i)
 }
end

to_b(0,67)
to_b(1,99)

32.times{|i|
 32.times{|j|
  a(67+i,99+j,132)
  c(3,132,133)
  a(134+i+j,133,134+i+j)
 }
}

64.times{|i|
 i.times{a(134+i,134+i,134+i)}
 a(2,134+i,2)
}

# STDERR.puts "Q = #{Q.size}"
# STDERR.puts A.map.with_index{|x,i|x||=0;"#{i}:#{x}"}*" "

puts Q.size
puts Q