402655: GYM100834 D Polycarp and the Table
Description
Polycarp decided to help to organize the Contest and create logins for each team. He has got a table consisting of N + 1 rows and M columns in the CSV format. It means that the table looks like a text which consists of N + 1 lines. Each line i is written as "ai, 1;ai, 2;... ;ai, m" (without quotations), where ai, j — cell content at the intersection of the row i and the column j. Each cell content corresponds to the line 1 to 30 signs long. A cell can contain only small and capital Latin letters and digits. The first line contains the names of the columns. They always contain "Team", "City", "Email", "Organization", "Participant1", "Participant2" and "Participant3" — team name, city, email address, organization name and participant name respectivly. Columns can be arranged in any order.
Polycarp has to make one more table in the same format including the table fields "Team", "Login", "Email", "Participants" — team name, login, email address and participants respectivly. The login looks like "team<XXX> (<Organization>, <City>)", where <XXX> — three-figure number of the team in the origina table, Organization and City — organization and city names respectivly. The participants complete it as follows: "<Participant1>,<Participant2>,<Participant3>" — participants’ names comma separated.
InputThe table looks like a table consisting of N + 1rows and M columns. 1 ≤ N ≤ 100, 1 ≤ M ≤ 15. The format of data is given in the statement.
OutputThe table consists of N + 1 rows in the format given in the statement.
ExamplesInputCountry;Organization;City;Team;Email;Output
Participant1;Participant2;
Participant3$
Russia;KFU;Kazan;KFU01;team01;P1;P2;
P3$
Russia;KFU;Kazan;KFU02;team02;P4;P5;
P6$
Russia;KFU;Kazan;KFU03;team03;P7;P8;
P9$
Russia;ITMO;SaintPetersburg;ITMO00;
somefakemail;I1;I2;I3$
Team;Login;Email;Participants$Note
KFU01;team001 (KFU, Kazan);team01;
P1,P2,P3$
KFU02;team002 (KFU, Kazan);team02;
P4,P5,P6$
KFU03;team003 (KFU, Kazan);team03;
P7,P8,P9$
ITMO00;team004 (ITMO, SaintPetersburg);
somefakemail;I1,I2,I3$
Line breaks in the example are marked using $, due text does not fit in the page.