#CCBCHBAHAI0000049. Bảng mưa hai năm (Two-Year Rainfall Table)

Bảng mưa hai năm (Two-Year Rainfall Table)

Bảng mưa hai năm (Two-Year Rainfall Table)

Source: Problem Solving and Program Design in C

Version: Phuoc Hung OJ Extended

Problem

You are given monthly rainfall for two consecutive years. For year y∈{1,2}y\in\{1,2\} and month m∈{1,2,…,12}m\in\{1,2,\ldots,12\}, let ry,mr_{y,m} be the rainfall in millimetres.

The yearly total is

Ty=∑m=112ry,m,T_y=\sum_{m=1}^{12}r_{y,m},

and the monthly average is

Ay=Ty12.A_y=\frac{T_y}{12}.

For every month mm, define

$$c_m= \begin{cases} -1,&r_{1,m}<r_{2,m},\\ 0,&r_{1,m}=r_{2,m},\\ 1,&r_{1,m}>r_{2,m}. \end{cases}$$

Compute T1,A1,T2,A2T_1,A_1,T_2,A_2 and c1,c2,…,c12c_1,c_2,\ldots,c_{12}.

Input

The first line contains 12 integers r1,1,…,r1,12r_{1,1},\ldots,r_{1,12}. The second line contains 12 integers r2,1,…,r2,12r_{2,1},\ldots,r_{2,12}.

Output

Line 1 prints T1T_1 and A1A_1. Line 2 prints T2T_2 and A2A_2. Each average must be printed with exactly 6 digits after the decimal point. Line 3 prints c1,c2,…,c12c_1,c_2,\ldots,c_{12}.

Subtask

Subtask 1 (100 points): 0≤ry,m≤1060\le r_{y,m}\le10^6.

Example

Input

10 20 30 40 50 60 70 80 90 100 110 120
15 15 35 35 55 55 75 75 95 95 115 115

Output

780 65.000000
780 65.000000
-1 1 -1 1 -1 1 -1 1 -1 1 -1 1

Explanation

Both years total 780780 mm and average 6565 mm/month. In month 1, year 1 has less rain so c1=−1c_1=-1; in month 2, year 1 has more rain so c2=1c_2=1; the same alternating pattern continues.