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×3. On intersection of the i-th row and the j-th column a text of length a_ij is placed. The total width of the table is w symbols. The text editor allows to change width of every column in arbitrary way. Let widths of the columns be x, y, z, and x+y+z=w. Then height of the i-th row is h_i=max(⌈a_i1/x⌉,⌈a_i2/y⌉,⌈a_i3/z⌉), and the total height of the table is h=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 w (3≤w≤109).
The following three lines contain three integers each. The j-th number in the i-th of these lines is integer a_ij (1≤a_ij≤1012).
In the first line output integer h --- the minimum possible height of the whole table.
In the second line output three integers x, y, and z --- 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``lgood | neutra``lgood | chaoti``cgood |
lawfu``lneut``ral | neutra``l | chaoti``cneutr``al |
lawfu``levil | neutra``levil | chaoti``cevil |