def lscan; gets.chomp.split.map(&:to_i); end omochi = 0 gets.to_i.times do n = lscan aa = lscan o = aa.reduce(:+) omochi += o p omochi end