P2364 Fat Boy
Description
As we know, Mike has happily gotten married, and last month he gained $70$ pounds. Because of too much fat on his fingers, even writing an email to his closest friend Slavko is difficult for him.
Every night Mike carefully describes everything he ate that day, but sometimes when he wants to press a key once, he presses it more than once, and his fat fingers may also hit keys he does not intend to press. Mike knows his fingers are a problem, so he types very carefully: for each intended character, the number of mistakenly typed characters does not exceed $3$. The mistaken characters may appear either before or after the correct character.
After receiving several unreadable emails, Slavko asked Mike to send each email $3$ times to make it easier to read.
Write a program to help Slavko determine the longest letter Mike could have intended, based on the three emails he received.
Input Format
The input consists of three lines of text. Each line is one version of Mike’s letter. All characters are lowercase English letters, and the length of each line does not exceed $100$.
Output Format
Output a single line containing the longest letter that Slavko can infer from the received emails. You may assume that a solution exists, but it is not necessarily unique.
Explanation/Hint
SPJ provided by @zhouyonglong.
Translated by ChatGPT 5