Format a Table

아직 제출이 없습니다시간 제한5초메모리 제한64 MB

문제

Little Vadim has got a homework at school: he have to describe characters of one famous literary work. Vadim has successfilly finished his homework and drawn a report in form of a spreadsheet in his favorite text editor. 

The spreadsheet has the following structure. It is a table of size 3×33 \times 3. On intersection of the ii-th row and the jj-th column a text of length a_ija\_{ij} is placed. The total width of the table is ww symbols. The text editor allows to change width of every column in arbitrary way. Let widths of the columns be xx, yy, zz, and x+y+z=wx+y+z=w. Then height of the ii-th row is h_i=max(a_i1/x,a_i2/y,a_i3/z)h\_i = \max \left( \lceil a\_{i1} / x \rceil, \lceil a\_{i2} / y \rceil, \lceil a\_{i3} / z \rceil \right), and the total height of the table is h=h_1+h_2+h_3h = h\_1 + h\_2 + h\_3.

Vadim noticed that changing widths of the columns changes heigth of the whole table in unpredictable way. Vadim is a perfectionist, and he wants to change widths of the columns in such a way that the total height of the table is minimal.

Help Vadim and find the optimal solution.

입력

The first line contains integer ww (3w1093 \le w \le 10^9).

The following three lines contain three integers each. The jj-th number in the ii-th of these lines is integer a_ija\_{ij} (1a_ij10121 \le a\_{ij} \le 10^{12}).

출력

In the first line output integer hh --- the minimum possible height of the whole table.

In the second line output three integers xx, yy, and zz --- widths of columns that imply the optimal solution.

If there are several solutions --- output any of them.

힌트

The following table match data from the first sample:

lawfu``lgoodneutra``lgoodchaoti``cgood
lawfu``lneut``ralneutra``lchaoti``cneutr``al
lawfu``levilneutra``levilchaoti``cevil