printРабочее место участника

printЗадачи

1852. Lists and Columns

Ограничения: время – 500ms/1000ms, память – 32MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод copy
Послать решение Blockly Посылки Темы Где Обсудить (0)

Write the program, which will transform lists of words into table columns. The first column should contain words of the first list, second column should contain words of the second list, and so on. Words should be written without skips in same order as in the lists. The width of a column is equal to the length of the longest word of this column. Columns should be separated by one space.
Input
The input file contains `N` lines (`1\ ≤\ N\ ≤\ 100`) of length up to 200 characters. Each line contains the nonempty list of words consisting of letters. Words are separated by commas. The lines do not contain spaces. The new-line character ends each line.
Output
Write into the output file the table of `N` columns containing all words from lists. No spaces are allowed at the end of lines.

Sample Input

Bill,Jo,Robert,Sally
Ann,Sam,Carolyn
fire,grain,cat,column,store

Sample Output

Bill   Ann     fire
Jo     Sam     grain
Robert Carolyn cat
Sally          column
               store
loading