Banking
The young Lombard, Guccio Baglioni (a character from the works of French writer Maurice Druon), frequently undertook secret missions for the influential figures of France, England, and Italy during his era. Unable to personally oversee his affairs for three years, he decided to invest his money with Parisian bankers to earn a profit. Each banker offered a different rate of return (Help the young Lombard maximize his wealth.
Input
The first line contains the number of livres m (1 ≤ m ≤ 100) that Guccio can invest, and the number of Parisian bankers n (1 ≤ n ≤ 100).
For each j from 1 to m, the (j + 1)-th line contains a sequence of n natural numbers. The k-th number in this sequence represents the amount of coins Guccio will receive in three years from the k-th banker if he invests j coins with them before his departure.
Output
The first line should display the maximum number of livres the young Lombard can have after 3 years by wisely investing his m livres.
The second line should present a sequence of n non-negative integers. The k-th number in this sequence indicates the number of livres Guccio should allocate to the k-th banker to achieve the maximum possible profit from his investments (at least one optimal distribution should be provided).