def z(x)gets.split.map(&:to_i).reduce(x)end p [-1,z(:*)-z(:+)].max