The world's best IT company Oondex is coming to Lineland! After years of facing annoying "This service is not available in your area" error messages, Linelanders will finally be able to listen to the most popular music, watch fresh viral videos and use lots of other opportunities provided by Oondex's services.
Lineland can be seen as a real coordinate line. It has unusual network tariffs: connecting two servers d kilometers apart from each other with a network channel of throughput t Mbit/s costs d⋅t dollars.
In order to provide better user experience, Oondex is going to place n servers in Lineland. These servers will be performing regular data processing activities which requires intense pairwise network interaction between these servers. At the same time, these servers are going to serve external users using m special CDN servers (which are specialized content delivery servers) already present in Lineland.
Analysts of Oondex determined for each pair i, j (1≤i<j≤n) the required throughput d_ij Mbit/sec between servers i and j, and also for each pair i, k (1≤i≤n; 1≤k≤m) the required throughput c_ik Mbit/sec between server i and CDN server k.
Given the locations of CDN servers a_k (1≤k≤m), determine the locations x_i (1≤i≤n) such that the cost of placing servers into them is the minimum possible. Formally, determine x_i such that the cost value of v=∑_1≤i<j≤n∣x_i−x_j∣⋅d_ij+∑_1≤i≤n 1≤k≤m∣x_i−a_k∣⋅c_ik is the minimum possible. Multiple servers (both Oondex and CDN) may be located at the same point.
The first line contains two integers n and m (1≤n,m≤70) --- the number of Oondex servers to place and the number of existing CDN servers.
The second line contains m integers a_1,a_2,…,a_m (0≤a_k≤106) --- the locations of existing CDN servers.
The i-th of the next n lines contains m integers c_i1,c_i2,…,c_im where c_ik (0≤c_ik≤50) is the throughput between i-th Oondex server and the k-th CDN server.
Finally, the i-th of the next n lines contains n integers d_i1,d_i2,…,d_in (0≤d_ij≤50; d_ij=d_ji; d_ii=0) where d_ij is the throughput between j-th Oondex server and the i-th Oondex server.
On the first line output the value v --- the minimum possible cost of placing n Oondex servers.
On the second line output n integers x_1,x_2,…,x_n where x_i (0≤x_i≤106) --- the coordinates at which the i-th Oondex server should be placed. It can be proven that an optimum answer satisfying these restrictions on x_i (range and integrality) exists.