Here is the problem: 762C - Two strings.
When $$$a=\texttt{abcdcba}$$$ and $$$b=\texttt{abdcdba}$$$, the answer may be $$$\texttt{abcdba}$$$ or $$$\texttt{abdcba}$$$.
Why doesn't the problem have "if there are multiple solutions, print any"?
I also wonder whether the data contains this kind of input.