eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Magic Star

Magic Star

A magic star consists of all the numbers from \textbf{1} to \textbf{12} arranged in the shape of a hexagram: \includegraphics{https://static.e-olymp.com/content/75/7528b47ff621cc6352dfc8df0afd1f083bac3074.jpg} The magic comes from the fact that in each line of \textbf{4} numbers, the sum of the numbers is \textbf{26}. In the example given above, the six lines consist of the following numbers: \begin{itemize} \item \textbf{1 + 4 + 10 + 11} \item \textbf{11 + 5 + 3 + 7} \item \textbf{7 + 6 + 12 + 1} \item \textbf{2 + 10 + 5 + 9} \item \textbf{9 + 3 + 6 + 8} \item \textbf{8 + 12 + 4 + 2} \end{itemize} There are several possible ways to arrange the numbers to get a magic star. Given a partially labelled star, your task is to extend the solution such that a magic star is formed. \InputFile The input consists of a visualization of the star; the unlabelled fields of the star will be represented by an '\textbf{x}' character, and labelled fields will contain a letter between '\textbf{A}' and '\textbf{L}', where the \textbf{i}-th letter in the alphabet represents number \textbf{i}. The character '\textbf{.}' is used to align the fields of the star in the shape of a hexagram. You may assume that each input will use the same alignment of the fields as the one in the sample input. \OutputFile Print the lexicographically smallest extension of the given partial solution which is a magic star (lexicographically smallest means that the concatenation of the rows should result in a string which is lexicographically smaller than other potential solutions). You may assume that there is always a solution for the given input.
Ліміт часу 1 секунда
Ліміт використання пам'яті 64 MiB
Вхідні дані #1
....x....
.A.I.D.x.
..x...x..
.x.x.x.x.
....x....
Вихідні дані #1
....F....
.A.I.D.L.
..H...E..
.C.J.B.K.
....G....
Джерело ACM ICPC German Collegiate Programming Contest 2011