Two Lines (Easy)
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
You are given two strings, each with a maximum length of 100 characters. A string is considered good if, by repeating it enough times, both of the given strings appear as substrings in the resulting sequence. For instance, given the strings ababa and bab, the string ab is good because repeating it twice yields ababab, which contains 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. Each string is composed of characters with ASCII codes ranging from 33 to 127. The length of each string does not exceed 100 characters.
Output
Write the shortest good string to the output file. If there are multiple shortest good strings, you may output any one of them.
Examples
Input #1
Answer #1
Submissions 93
Acceptance rate 11%