ZERO = 1000
ONE = 999
TEMP1 = 998
TEMP2 = 997

puts 576

def set_zero(i)
  puts "< #{i} #{i} #{i}"
end

def set_one(i, j)
  puts "< #{i} #{j} #{i}"
end

def set_and(i, j, k)
  puts "< #{ZERO} #{i} #{TEMP1}"
  puts "< #{ZERO} #{j} #{TEMP2}"
  puts "+ #{i} #{j} #{k}"
  puts "< #{ONE} #{k} #{k}"
end

def increment(i, j)
  puts "+ #{i} #{j} #{i}"
end

def twice(i)
  puts "+ #{i} #{i} #{i}"
end

k = 999
set_one(k, 0)

(1..10).each do |i|
  i.times { increment(1000 + i, k) }
end

(1..10).each do |i|
  puts "< #{1000 + i} #{0} #{2000 + i}"
end

(1..10).each do |i|
  puts "< #{1000 + i} #{1} #{3000 + i}"
end

(1..10).each do |j|
  (1..10).each do |i|
    set_and(2000 + i, 3000 + j, 3)
    increment(2, 3)
  end
end
