System.in.eachLine{b=[] a=it.split()*.toInteger() a.size().times{s=v=0 a.each{b[(v+=it)+1000]=s+=' '+it} a=a[1..-1]<