Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
358 B
8
Indexable
Never
a = int(input())
kata1 = str(input())
b = int(input())
kata2 = str(input())

if a > b:
    x = b
    y = a - b
else:
    x = a
    y = b - a
    
ans = 0

while x:
    tmp = 0
    for i in range(x):
        if kata1[y + i] == kata2[i]:
            tmp += 1
    if tmp == x:
        ans = x
    y += 1
    x -= 1

for i in range(ans):
	print(kata2[i],end="")