Two lines
You are given two strings, each with a maximum length of 50,000 characters. We define a string as good if, when repeated enough times, it forms a new string that contains both of the given strings as substrings. For instance, consider the strings ababa and bab. The string ab is good because repeating it twice results in ababab, which includes both of the given strings as substrings.
Your task is to find the shortest good string for the two provided strings.
Input
The input consists of two strings. These strings are made up of characters with ASCII codes ranging from 33 to 127. Each string's length does not exceed 50,000 characters.
Output
Output the shortest good string to the output file. If there are multiple shortest good strings, you may output any one of them.