line = gets.split(' ').map(&:to_i)

if line == [0, 0, 0, 0]
  puts 0
  exit
end

f = line[0,2]
s = line[2,2]

line.reject!{|x| x == 0}
f.reject!{|x| x == 0}
s.reject!{|x| x == 0}
arr = []
f.each do |x|
  s.each do |y|
    arr << x * y
  end
end

puts arr.max