ARGV.each do |f|
  f0 = File.basename(f)
  cont = ""
  puts "====== " + f0
  open(f) do |t|
    u = false
    while line = t.gets
      if line =~ /require /
	u = true
	next
      else
	if u
	  cont.concat "require \"algebra\"\n"
	  u = false
	end
	cont.concat line
      end
    end
  end
#  print cont
#  puts "------ " + f0
#  puts 
  open(f0, "w") do |t|
    t.binmode
    t.print cont
  end
end

  
