loop do
  print 
  expr = gets.strip.downcase 
  break if expr.empty?

  vars = expr.scan(/\p{Alpha}+/)
  if vars.empty?
    puts 
    next
  end

  vars.each {|v| print }
  puts 

  prefix = []
  suffix = []
  vars.each do |v|
    prefix << 
    suffix << 
  end

  body = vars.inject() {|str, v| str + } 
  body += ' + eval(expr).to_s'

  eval (prefix + [body] + suffix).join()
end