R = gets.to_i S = gets if (S.split.size == R) then puts '"assert"' exit end # 3C2 -> 総和 -> 一意化 -> 2番目に大きい数 puts ([S] + Array.new(R - 1) { gets.to_i }).combination(2).map{|x| x.reduce(:+)}.uniq.sort[-2]