gets a=gets.split.map(&:to_i) m=a.max p [a.map{|i|i^m}.max,m].min