num = gets.to_i.split("\n") str = gets.to_s sum = 0 num.each{|n| sum = sum + n } puts sum + "\s" + str