gets x=y=0 readlines.map{|s| a=s.chomp.split('.') x += a[0].to_i y += (s[0]=='-' ? -1 : 1) * ((a[1]==nil ? '' : a[1]) + "0000000000000000000")[0..9].to_i } M=10000000000 while y < 0 y += M x -= 1 end x += y/M y %= M if x >= 0 or y != 0 puts sprintf("%d.%010d",x,y) else puts sprintf("%d.%010d",x+1,M-y) end