first = input()
second = input()
answer = ""
first_length = len(first)
second_length = len(second)
for i in range(first_length):
overlap = ""
for j in range(second_length):
if i + j < first_length \
and first[i + j] == second[j]:
overlap += second[j]
if i + j == first_length - 1 \
and len(overlap) > len(answer):
answer = overlap
else:
break
if answer != '':
print(answer)
else:
print('No overlapping')
Comments
Leave a comment