In AMPPZ 2025, $80$ teams from $27$ institutions are competing. The abbreviations of these institutions are UW, UJ, UWR, MAP, PW, AGH, PG, NLU, PUT, PO, PWR, SGGW, UMCS, UR, ZUT, DTP, GOO, HUA, KUL, PL, PM, PS, UAM, UG, UMK, UO, WAT. Here is the complete table showing the number of teams from each institution*:
| full name | abbreviation | number of teams |
|---|---|---|
| Uniwersytet Warszawski | UW | 11 |
| Uniwersytet Jagielloński | UJ | 9 |
| Uniwersytet Wrocławski | UWR | 8 |
| Mistrzostwa w Algorytmice i Programowaniu (secondary schools) | MAP | 7 |
| Politechnika Warszawska | PW | 6 |
| Akademia Górniczo-Hutnicza im. Stanisława Staszica w Krakowie | AGH | 5 |
| Politechnika Gdańska | PG | 4 |
| Wyższa Szkoła Biznesu - National-Louis University | NLU | 3 |
| Politechnika Poznańska | PUT | 3 |
| Politechnika Opolska | PO | 2 |
| Politechnika Wrocławska | PWR | 2 |
| Szkoła Główna Gospodarstwa Wiejskiego w Warszawie | SGGW | 2 |
| Uniwersytet Marii Curie-Skłodowskiej w Lublinie | UMCS | 2 |
| Uniwersytet Rzeszowski | UR | 2 |
| Zachodniopomorski Uniwersytet Technologiczny w Szczecinie | ZUT | 2 |
| Digital Technology Poland | DTP | 1 |
| GOO | 1 | |
| Huawei | HUA | 1 |
| Katolicki Uniwersytet Lubelski Jana Pawła II | KUL | 1 |
| Politechnika Łódzka | PL | 1 |
| Politechnika Morska w Szczecinie | PM | 1 |
| Politechnika Śląska | PS | 1 |
| Uniwersytet im. Adama Mickiewicza w Poznaniu | UAM | 1 |
| Uniwersytet Gdański | UG | 1 |
| Uniwersytet Mikołaja Kopernika w Toruniu | UMK | 1 |
| Uniwersytet Opolski | UO | 1 |
| Wojskowa Akademia Techniczna | WAT | 1 |
*The list of teams may change slightly between the preparation of this task and the contest.
The contest hall is an $8 \times 10$ grid consisting of $8$ rows with $10$ workstations each. To prevent unauthorized communication, the organizers must find an arrangement in which teams from the same institution do not sit next to each other – neither sharing an edge nor a corner.
The audience has its favorite – a team from the institution whose abbreviation is given in the input. The film crew has already set up their cameras in the top-left corner of the contest hall, so one team from the institution given in the input must be seated there.
Find any arrangement of teams that satisfies the given conditions.
Input
The only line contains a word consisting of $2$ to $4$ uppercase letters – the abbreviation of the favorite institution (one of the $27$ listed above).
Output
Print the found arrangement of teams – $8$ lines, each with $10$ words (abbreviations) separated by spaces. The first word in the first line must match the favorite institution provided in the input. If multiple solutions exist, print any of them.
Note
In the example test, the audience's favorite is Uniwersytet Wrocławski†. The provided output contains correct abbreviations and counts, and UWR indeed appears in the top-left corner. However, this is not a valid output, because in many places teams from the same institution are adjacent to each other. Below, three example collisions are highlighted in bold.
| UWR | MAP | MAP | UJ | PL | UW | UW | SGGW | ZUT | GOO |
| MAP | PUT | UR | KUL | UW | UW | PM | AGH | UWR | AGH |
| PS | UJ | UWR | UW | UWR | MAP | UWR | PG | UWR | PWR |
| PW | HUA | PW | AGH | PG | DTP | UW | UW | UW | PWR |
| MAP | UG | NLU | UJ | PUT | UAM | UW | UJ | UJ | UW |
| NLU | ZUT | PW | WAT | UWR | AGH | UMCS | UR | UJ | AGH |
| PUT | UJ | SGGW | PG | PW | MAP | PO | MAP | UJ | UWR |
| UMCS | PO | PW | PW | UO | UW | PG | UJ | NLU | UMK |
†Perhaps because one of UWR's teams won the previous edition of AMPPZ.