class Rectangle
  def initialize(height, width)
    @height = height
    @width = width
  end

  def area
    @height * @width
  end

  def perimeter
    (@height + @width) * 2
  end

  attr_accessor :height, :width
end

def read_input
  height, width = gets.split(" ").map {|x| x.to_i}
end

height, width = read_input
rectangle = Rectangle.new(height, width)
puts "#{rectangle.area} #{rectangle.perimeter}"