A = [1000000000,1000000000]
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)
0.upto(28){|i|
 a(3+i,3+i,4+i)
}

def to_b(x,s)
 a(x,3,x)
 29.downto(0){|i|
  a(3+i,s+30+i+1,s+30+i)
  c(s+30+i,x,s+i)
  a(s+i,2,s+30+i)
  i.times{a(s+30+i,s+30+i,s+30+i)}
  a(s+30+i,s+30+i+1,s+30+i)
 }
end

to_b(0,33)
to_b(1,195)

30.times{|i|
 30.times{|j|
  a(33+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)
}

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

puts Q.size,Q
