s = eval(input())

mmax = 0

n = len(s)

while(n>1):

  s = s[0:n-1]

  n = len(s)

  if n<2:

    break

  if s[0:int(n/2)]==s[int(n/2):n]:

    mmax = max(mmax, n)

print(mmax)
S = eval(input())

n = len(S)

for i in range(1,n):

    if (n-i)%2 == 1:

        continue

    if S[0:int((n-i)/2)]==S[int((n-i)/2):n-i]:

        print((len(S[0:n-i])))

        exit()
s = eval(input())
mmax = 0
n = len(s)
while n > 1:
    s = s[0 : n - 1]
    n = len(s)
    if n < 2:
        break
    if s[0 : int(n / 2)] == s[int(n / 2) : n]:
        mmax = max(mmax, n)
print(mmax)

S = eval(input())
n = len(S)
for i in range(1, n):
    if (n - i) % 2 == 1:
        continue
    if S[0 : int((n - i) / 2)] == S[int((n - i) / 2) : n - i]:
        print((len(S[0 : n - i])))
        exit()

-s = eval(input()) -mmax = 0 -n = len(s) -while n > 1: -    s = s[0 : n - 1] -    n = len(s) -    if n < 2: -        break -    if s[0 : int(n / 2)] == s[int(n / 2) : n]: -        mmax = max(mmax, n) -print(mmax) +S = eval(input()) +n = len(S) +for i in range(1, n): +    if (n - i) % 2 == 1: +        continue +    if S[0 : int((n - i) / 2)] == S[int((n - i) / 2) : n - i]: +        print((len(S[0 : n - i]))) +        exit()