Problem:
 Score : 200 points    Problem Statement We will call a string that can be obtained by concatenating two equal strings an even string.
For example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.  You are given an even string S consisting of lowercase English letters.
Find the length of the longest even string that can be obtained by deleting one or more characters from the end of S .
It is guaranteed that such a non-empty string exists for a given input.      Constraints  2 \leq |S| \leq 200  S is an even string consisting of lowercase English letters.  There exists a non-empty even string that can be obtained by deleting one or more characters from the end of S .         Input Input is given from Standard Input in the following format:  S       Output Print the length of the longest even string that can be obtained.        Sample Input 1 abaababaab      Sample Output 1 6   abaababaab itself is even, but we need to delete at least one character.  abaababaa is not even.  abaababa is not even.  abaabab is not even.  abaaba is even. Thus, we should print its length, 6 .        Sample Input 2 xxxx      Sample Output 2 2   xxx is not even.  xx is even.        Sample Input 3 abcabcabcabc      Sample Output 3 6  The longest even string that can be obtained is abcabc , whose length is 6 .       Sample Input 4 akasakaakasakasakaakas      Sample Output 4 14  The longest even string that can be obtained is akasakaakasaka , whose length is 14 .

Solution (Python):
s=list(input())
while len(s)!=0:
    s.pop()
    if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]:
        print(len(s))
        exit()

Solution (Python):
s = input()
i = 1
while s[:(len(s)-2*i)//2] != s[(len(s)-2*i)//2:-2*i]:
    i += 1
else:print(len(s)-2*i)

Solution (Python):
s = input()
for i in range(1,len(s)):
    if s[:(len(s)-2*i)//2] == s[(len(s)-2*i)//2:-2*i]:
        print(len(s)-2*i)
        break

Solution (Python):
S = input()

def ok(s):
  n = len(s) 
  if n % 2 == 1:
    return False
  else:
	
    return s[0:n//2] == s[n//2:]

for i in range(1, len(S)+1):
  if ok(S[0:len(S)-i]):
    print(len(S)-i)
    break

Solution (Python):
S = list(input())

for i in range(1,len(S),2):
    m = int((len(S) - i) / 2)
    a = S[:m]
    b = S[m:len(S)-i-1]
    if(a == b):
        print(len(a)+len(b))
        break

Solution (Python):
s = input()
for i in range(len(s) - 2, 0, -1):
    target_s = s[:i]
    if len(target_s) % 2 != 0:
        continue
    if target_s[: int(len(target_s) / 2)] == target_s[int(len(target_s) / 2) :]:
        print(len(target_s))
        exit()

Solution (Python):
S=list(input())
lenS=len(S)
ans=0

if lenS%2==0:
  for l in range(lenS//2-1):
    check=0
    for k in range(l+1):
      if S[k]==S[k+l+1]:
        check+=1
    if check==l+1:
      ans=check*2
  print(ans)

else:
  for l in range(lenS//2):
    check=0
    for k in range(l+1):
      if S[k]==S[k+l+1]:
        check+=1
    if check==l+1:
      ans=check*2
  print(ans)

Solution (Python):
s=input()

s=s[:-1]
half=len(s)//2
while s[:half]!=s[half:]:
    s=s[:-1]
    half=len(s)//2
    
print(len(s))

Solution (Python):
s = list(input())

while len(s) > 1:
  last_char = s.pop(-1)
  len_str = len(s)
  if(len_str % 2 != 0):
    continue
  if(s[0:len_str//2] == s[len_str//2:]):
    print(len(s))
    exit()

Solution (Python):
S = input()
S = S[:-1]

half = len(S)//2
while S[:half] != S[half:]:
    S = S[:-1]
    half = len(S)//2

print(len(S))

Solution (Python):
import sys
sys.setrecursionlimit(int(1e6))

S = input()

ans = 0
for n in range(len(S)-1, 1, -1):
  if n % 2:
    continue
  s = S[0:n]
  m = n // 2
  
  if s[0:m] == s[m:n]:
    ans = n
    break
  
print(ans)

Solution (Python):
s=input()
if len(s)%2==1:
    s=s[:-1]
else:
    s=s[:-2]

for i in range(len(s)):
    n=len(s)
    if s[:n//2]==s[n//2:]:
        print(n)
        break
    else:
        s=s[:-2]
else:
    print(-1)

Solution (Python):
s = input()

for i in range(len(s)-2, 0, -2):
    s = s[:i]
    h = len(s)//2
    if s[:h] == s[h:]:
        print(len(s))
        break

Solution (Python):
s=list(input())
while len(s)!=0:
    s.pop()
    if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]:
        print(len(s))
        exit()

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    s = s[:len(s)-1]
    while True:
        if len(s) % 2 == 0:
            if s[:len(s)//2] == s[len(s)//2:]:
                print(len(s))
                exit()
        s = s[:len(s)-1]


if __name__ == '__main__':
    slove()

Solution (Python):
s = [i for i in input()]
for i in range(1,len(s)//2):
  count = 0
  for j in range(len(s)//2-i):
    if s[j] == s[j+len(s)//2-i]:
      count += 1
    if count == len(s)//2-i:
      print(len(s)-i*2)
      exit()

Solution (Python):
s = input()
for i in reversed(range(2, len(s), 2)):
  news = s[:i]
  lns = len(news)
  if news[:lns//2] == news[lns//2:]:
    print(i)
    break

Solution (Python):
s=input()
for i in range(len(s),0,-1):
    ss=s[:i-1]
    if ss[:len(ss)//2]==ss[len(ss)//2:]:
        print(len(ss))
        exit()

Solution (Python):
s=input()
n=len(s)
ans=""
import math
for i in range(1,n):
    if i%2==1:
        continue
    ss=s[:i]
    m=len(ss)
    p=0
    for j in range(m//2):
        if ss[j]!=ss[j+m//2]:
            p=1
            break
    if p==0:
        ans=ss
print(len(ans))

Solution (Python):
s = [i for i in input()]
s = s[:-1]
while s[:len(s)//2] != s[len(s)//2:]:
  s = s[:-1]
print(len(s))

Solution (Python):
s = input()
s = s[:-1]
while len(s)%2!=0 or s[:len(s)//2]!=s[len(s)//2:]: s = s[:-1]
print(len(s))

Solution (Python):
s = input()
for i in range(len(s)):
  s = s[:-2]
  if s[:len(s)//2] == s[len(s)//2:]:
    print(len(s))
    exit()

Solution (Python):
s=input()
s=s[:-1]

for i in range(len(s)):
    s_1=s[:len(s)//2]
    s_2=s[len(s)//2:]
    if all(s.count(x)%2 == 0 for x in s) and s_1 == s_2 or len(s) == 2:
        print(len(s))
        break
    else:
        s=s[:-1]

Solution (Python):
S=input()

def ss(S):
    if len(S)%2==0:
        
        for i in range(2,len(S),2):
            s=S[:len(S)-i]
            
            if s[:len(s)//2]==s[len(s)//2:]:
                return print(len(s))
    else:
        
        for i in range(1,len(S),2):
            s=S[:len(S)-i]
            
            if s[:len(s)//2]==s[len(s)//2:]:
                return print(len(s))
    return

ss(S)

Solution (Python):
s = input()

while True:
    s = s[:len(s) - 1]
    if len(s) % 2 != 0:
        continue
    mid = len(s) // 2
    if s[:mid] == s[mid:]:
        print(len(s))
        break

Solution (Python):
s = input()
n = len(s)
for i in range(1, n):
    if (n - i) % 2 == 0:
        if s[0:(n - i) // 2] == s[(n - i) // 2:n - i]:
            print(n - i)
            exit()

Solution (Python):
def main():
    s=input()
    s=s[:-2]
    ans = len(s)
    while s[:len(s)//2] != s[len(s)//2:] and len(s)!=0:
        s=s[:-2]
        ans -=2
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
s=input()
n=len(s)//2
for i in range(n):
  if s[:n-i-1]==s[n-i-1:2*(n-i-1)]:
    print((n-i-1)*2)
    break
  else:
    continue

Solution (Python):
s=[i for i in input()]
for i in range(len(s)-1):
    s.pop(-1)
    x=len(s)//2
    if len(s)==1:print(1)
    elif s[:x]==s[x:]:
        print(x*2)
        break

Solution (Python):
inputStr = list(input())
def evenStrJudg(s):
  sameCheck = True
  if len(s) % 2 != 0:
    sameCheck = False
  else:
    for i in range(int(len(s) / 2)):
      if s[i] != s[i + int(len(s) / 2)]:
        sameCheck = False
        break
  return sameCheck

for i in range(int(len(inputStr) / 2)):
  del inputStr[-1]
  del inputStr[-1]
  if evenStrJudg(inputStr):
    break
print(len(inputStr))

Solution (Python):
s = input()

def is_even(s):
    for i in range(len(s) // 2):
        if s[i] != s[i + len(s) // 2]:
            return False
    return True

for i in range(len(s) - 2, 0, -2):
    if is_even(s[0:i]):
        print(len(s[0:i]))
        break

Solution (Python):
s = input()[:-1]
ans = -1

while len(s)>1:
  if len(s)%2 == 0:
    s_1 = s[:len(s)//2]
    s_2 = s[len(s)//2:]
    if s_1 == s_2:
      ans = len(s)
      break
      
  s = s[:-1]

print(ans)

Solution (Python):
s = input()
for i in range(len(s) - 3, 0, -2):
    if s[:i // 2 + 1] == s[i // 2 + 1:i + 1]:
        print(i + 1)
        exit()

Solution (Python):
import sys
S = input()
S = S[:-1]
for _ in range(len(S)):
    len_s = len(S)
    if len_s%2 == 0:
        s1 = S[:int(len_s/2)]
        s2 = S[int(len_s/2):len_s]
        if s1 == s2:
            print(len_s)
            sys.exit()
        else:
            S = S[:-1]
    else:
        S = S[:-1]

Solution (Python):
s = input()
n = len(s)
for i in range(1, n):
    if (n - i) % 2 == 0:
        if s[0:(n - i) // 2] == s[(n - i) // 2:n - i]:
            print(n - i)
            exit()

Solution (Python):
S = input()
s = len(S)

if s % 2 != 0:
    S = S[:-1]
    s = len(S)
else:
    S = S[:-2]
    s = len(S)

for i in range(s // 2):
    s = len(S)
    if S[:s // 2] == S[s // 2:]:
        print(s)
        exit()
    else:
        S = S[:-2]

Solution (Python):
S = list(input())
if len(S)%2 == 0:
    del S[-1]
    del S[-1]
    for i in range(len(S)):
        if S[0:(len(S))//2] == S[(len(S))//2::]:
            print(len(S))
            break
        else:
            del S[-1]
            del S[-1]
else:
    del S[-1]
    for i in range(len(S)):
        if S[0:(len(S))//2] == S[(len(S))//2::]:
            print(len(S))
            break
        else:
            del S[-1]
            del S[-1]

Solution (Python):
S=input()
N=len(S)-1
i=0
while(True):
    s=S[0:N-i]
    n=len(s)
    if n%2==0:
        if s[0:int(n/2)]==s[int(n/2):n]:
            print(N-i)
            break
    i+=1

Solution (Python):

S = list(str(input()))
N = len(S)
front = []
back = []
for i in range(N):
    if i < N//2:
        front.append(S[i])
    else:
        back.append(S[i])


for i in range(N):
    
    del back[-1]
    if i%2 == N%2:
        f = front.pop(-1)
        back.insert(0,f)
    if front == back:
        MAX = (N-i-1)
        break
        
print(MAX)

Solution (Python):
s = input()
for i in range(2, len(s), 2):
    end = len(s) - i
    half = end // 2
    if s[:half] == s[half:end]:
        ans = end
        break
print(ans)

Solution (Python):
s = input()[:-2]
while True:
    
    p = int(len(s)/2)-1
    
    if s[:p+1] == s[p+1:]:
        break
    s = s[:-2]
print(len(s))

Solution (Python):
s = input()
n = len(s)
for i in range(n - 2, 0, -2):
    if s[:(i // 2)] == s[(i // 2):i]:
        print(i)
        exit()

Solution (Python):
S=input()
c=[]
for i in range(1,len(S)//2+1):
    if S[0:i]==S[i:2*i]:
        c.append(S[0:i])


for i in range(1,len(c)+1):
    if c[-i]*2 in S[0:len(S)-1]:
        print(len(c[-i]*2))
        break

Solution (Python):
S = input()
end_idx = len(S)-2
S = S[:end_idx]
while len(S):
  if S[:len(S)//2] == S[len(S)//2:]:
    print(len(S))
    exit()
  else:
    end_idx = len(S)-2
    S = S[:end_idx]

Solution (Python):
s = list(input())
n = len(s) - 1
key = "F"
for i in range(n):
    if n % 2 == 0:
        key = "T"
        for i in range(n//2):
            if s[i] != s[i+n//2]:
                key = "F"
        if key == "T":
            print(n)
            break
        else:
            n -= 1
    else:
        n -= 1

Solution (Python):
s=input()
ans=float("inf")
for i in range(1,len(s)):
  nagasa=len(s)-i
  if nagasa%2==0:
    if s[0:(nagasa//2)]==s[(nagasa//2):nagasa]:
      print(nagasa)
      exit()

Solution (Python):
s=list(input())
del s[-2:]
k=len(s)//2
while s[:k]!=s[k:]:
    del s[-2:]
    k=len(s)//2
print(len(s))

Solution (Python):
s=list(input())

for i in range(len(s)//2):
    s=s[:-2]
    key=0
    for i in range(len(s)//2):
        if(s[i]!=s[i+len(s)//2]):
            key=1
    if(key==0):
        print(len(s))
        exit()

Solution (Python):



def main():

    S = list(input())
    S= S[0:-2] if len(S)%2==0 else S[0:-1]
    while(True):

        half = len(S)//2
        if S[0:half]==S[half:]:
            print(len(S))
            exit()
        else:
            S = S[:-2]






if __name__ == "__main__":
    main()

Solution (Python):
def main():
	s = input()
	for i in range(2,len(s),2):
		n = len(s) - i
		if s[:int(n/2)] == s[int(n/2):n]:
			print(n)
			break
	else:
		print('0')

if __name__ == "__main__":
	main()

Solution (Python):
s = input()[:-1]
while s[:len(s)//2] != s[len(s)//2:]:
    s = s[:-1]
print(len(s))

Solution (Python):
s = input().rstrip()
n = len(s)
res = 2
for i in range(2, n, 2):
    t = s[:i]
    if t[:i // 2] == t[i // 2:]:
        res = i
print(res)

Solution (Python):
s=[i for i in input()]

del s[-2:]
while s[:len(s)//2]!=s[len(s)//2:]:
    del s[-2:]
   
print(len(s))

Solution (Python):
s=input()[:-2]
while s[:len(s)//2]!=s[len(s)//2:]:s=s[:-2]
print(len(s))

Solution (Python):
s = input()
n = len(s)-2
while n > 0:
    if s[:n//2] == s[n//2:n]:break
    else: n = n-2
print(n)

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

S=input()
cnt=0
ct=0
while len(S)>0 and cnt==0:
	S=S[:-2]
	ct=0
	for i in range(len(S)//2):
		if S[i]==S[i+len(S)//2]:
			ct+=1
	if ct==len(S)//2:
		cnt+=1
		print(len(S))

Solution (Python):
s = input()
ans = 0
for i in range(len(s)-2, 0, -2):
    if s[:i//2] == s[i//2:i]:
        ans = i
        break
print(ans)

Solution (Python):
def resolve():
    s = input()
    ls = len(s)
    for i in range(1, ls - 1):
        t = s[:-i]
        lt = len(t)
        if lt % 2 == 0 and t[:lt // 2] * 2 == t:
            print(lt)
            return 0


if __name__ == "__main__":
    resolve()

Solution (Python):
S=input()

for i in reversed(range(len(S) - 1)):
  if i % 2 == 1:
    moji1 = S[0:(i//2) + 1]
    moji2 = S[(i//2) + 1: i+ 1]
    
    if moji1==moji2:
      print(i+1)
      break

Solution (Python):
S = input()

LengthS = len(S)
for i in range(100):
    LengthS = LengthS - 2
    HalfS = int(LengthS / 2)
    if S[:HalfS] == S[HalfS:LengthS]:
        print(LengthS)
        break

Solution (Python):
def ss(s):
    return s[:len(s)//2] == s[len(s)//2:]

S = input()
N = len(S)
for i in range(1, N-1):
    if ss(S[:N-i]):
        ans = N-i
        break
print(ans)

Solution (Python):
s = list(input())
for i in range ((len(s)//2-1),0,-1):
         for j in range(i):
                  if s[j] != s[j+i]:
                           break
         else:
                  print(i*2)
                  exit()

Solution (Python):
s = input()
n = len(s) - 2
while not(s[0:n//2] == s[n//2:n]):
  n = n - 2
print(n)

Solution (Python):
S = input()
i = 1
s = S
while s != "":
    s = S[:-2*i]
    L = len(s)
    if s[:L//2] == s[L//2:]:
        break
    i += 1
print(L)

Solution (Python):
S = input()
for i in range(2, len(S), 2):
    part_S = S[:-i]
    
    mid = len(part_S) // 2
    left_S = part_S[:mid]
    right_S = part_S[mid:]
    if left_S == right_S:
        print(len(part_S))
        exit()

Solution (Python):
s = input()

for c in range(len(s)-2,0,-2):
    s = s[:-2]
    if s[:c//2]==s[c//2:c]:
        print(c)
        exit()

Solution (Python):
s = input()

if len(s) % 2 == 1:
    s = s[:-1]
else:
    s = s[:-2]
while True:
    middle_index = len(s) // 2
    if s[:middle_index] == s[middle_index:]:
        print(len(s))
        exit()
    else:
        s = s[:-2]

Solution (Python):
S = input()
n = len(S) - 2
while S:
    if S[0:n//2] == S[n//2:n]:break
    n = n-2
print(n)

Solution (Python):
s=list(input())
h=len(s)
def ans(s):
    n=len(s)//2
    f=0
    for i in range(n):
        if s[i]!=s[i+n]:
            f+=1
            break
    if f==0:
        return True
    else:
        return False
      
s.pop(-1)
s.pop(-1)
kai=2
while not ans(s):
    s.pop(-1)
    s.pop(-1)
    kai+=2
print(h-kai)

Solution (Python):
s = input()
for i in range(1,len(s)):
    jisu=len(s)-i
    if (jisu)%2 == 1:
        continue
    if s[:jisu//2]==s[jisu//2:-i]:
        print(jisu)
        break

Solution (Python):
s = input()
for i in range(2,len(s),2):
    t = s[:len(s)-i]
    d = len(t)//2
    if t[:d] == t[d:]:
        print(len(t))
        break

Solution (Python):
import sys
s = list(input())
for i in range(len(s)//2):
  s.pop()
  s.pop()
  if s[:len(s)//2] == s[len(s)//2:]:
    print(len(s))
    sys.exit()

Solution (Python):
N = str(input())
N = N[:-1]

if len(N) % 2 == 1:
  N = N[:-1]


l = len(N)



r = int(l/2)
N_1 = N[0:r]
N_2 = N[r:l+1]






while l >= 2:
  if N_1 == N_2:
    
    print(len(N_1)*2)
    break
  else:
    l = l-2
    r = int(l/2)
    N_1 = N[0:r]
    N_2 = N[r:l]

Solution (Python):
s=input();print(max(i*(s[:i]==s[i:2*i])for i in range(len(s)//2))*2)

Solution (Python):
s=list(input())
for i in range(len(s)):
	s=s[:-2:]
	if len(s)%2!=0:continue
	l=len(s)//2
	if s[:l:]==s[l::]:
		print(l*2)
		exit()

Solution (Python):
e=lambda s:s[:len(s)//2]==s[len(s)//2:]
s=input()
while 1:
 s=s[:-2]
 if e(s):print(len(s));break

Solution (Python):
N = str(input())
N = N[:-1]

if len(N) % 2 == 1:
  N = N[:-1]


l = len(N)



r = int(l/2)
N_1 = N[0:r]
N_2 = N[r:l+1]






while l >= 2:
  if N_1 == N_2:
    
    print(len(N_1)*2)
    break
  else:
    l = l-2
    r = int(l/2)
    N_1 = N[0:r]
    N_2 = N[r:l]

Solution (Python):
s = input()
s = s[:-1]
while True:
    if len(s) % 2 == 0 and s[:int(len(s) / 2)] == s[int(len(s) / 2):]:
        print(len(s))
        break
    else:
        s = s[:-1]

Solution (Python):
import collections
S = list(input())
for i in range(len(S)-2,1,-2):
  S = S[:len(S)-2]
  if S[:len(S)//2] == S[len(S)//2:]:
    print(i)
    break

Solution (Python):
S=input()

if len(S)%2:
  S=S[:-1]
S=S[:-2]

n=len(S)
for i in range(n//2):
    
    
    if S[:len(S)//2]==S[len(S)//2:]:
      break
    S=S[:-2]
    
print(len(S))

Solution (Python):
s = input()
n = len(s)

for i in range(n-2)[::-2]:
    half = i // 2
    head = s[0:half+1]
    tail = s[half+1:i+1]
    if head == tail:
        print(i+1)
        break

Solution (Python):
S = input()
for i in range(1, len(S)):
    if len(S[:len(S)-i])%2==0:
        if S[:int((len(S)-i)/2)]==S[int((len(S)-i)/2):int(len(S)-i)]:
            print(len(S[:len(S)-i]))
            break

Solution (Python):
S = list(input())

ns = len(S)

n=2

while n<=len(S):
    na = int((ns-n)/2)
    if S[0:na]==S[na:ns-n]:      
        print(ns-n)
        break
    n+=2

Solution (Python):
S=input()

L=len(S)

for i in range(1,L//2+1):
    if S[0:(L-2*i)//2]==S[(L-2*i)//2:-i*2]:
        print(L-2*i)
        exit()

Solution (Python):
s = input()
i = 0
while len(s) > i:
    i += 2
    sLen = (len(s) - i)
    if s[0:sLen//2] == s[sLen//2:sLen]:
        print(sLen)
        break

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    s = input().strip()
    
    if len(s)&1:
        for i in range(len(s)-1, 0, -2):
            if s[:i//2] == s[i//2:i]:
                print(i)
                break
    else:
        for i in range(len(s)-2, -1, -2):
            if s[:i//2] == s[i//2:i]:
                print(i)
                break


if __name__ == "__main__":
    main()

Solution (Python):
s = input()
for i in range(len(s) // 2):
  s = s[:len(s) - 2]
  if s[:len(s)//2] == s[len(s)//2:]:
    print(len(s))
    break

Solution (Python):
s=input()
n=len(s)
while(1):
    n-=1
    if n%2==0:
        if s[0:n//2]==s[n//2:n]:
            print(n)
            exit()

Solution (Python):

S = input()
tmp = S[:]
for i in range(len(S)):
    tmp = S[:-i-1]
    if tmp[:len(tmp)//2] == tmp[len(tmp)//2:]:
        break
print(len(tmp))

Solution (Python):
S=str(input())
n=len(S)
for i in range(1,n):
    num=n-i
    if num%2==0:
        s1=S[0:num//2]
        s2=S[num//2:num]
        if s1==s2:
            ans=num
            break
print(ans)

Solution (Python):

import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

S = IS()
cnt = 0
max = 0
for i in range(len(S)//2):
    a = S[:i]
    b = S[i:2*i]
    if a == b and max < i:
        max = 2*i
print(max)

Solution (Python):
s = input()

for i in range(2, len(s), 2):
    l = len(s) - i
    if s[:l//2] == s[l//2:l]:
        print(l)
        break

Solution (Python):
s = input()
n = len(s)

M = [[0] * n for i in range(n)]
for i in range(1, n):
    M[0][i] = int(s[0] == s[i])

for i in range(1, n):
    for j in range(i+1, n):
        if s[i] == s[j] and M[i-1][j-1] + 1 <= j-i: 
            M[i][j] = M[i-1][j-1] + 1

M[n//2-1][n-1] = 0



ans = 0
for i in range(n):
    for j in range(i+1, n):
        if M[i][j] == j-i:
            ans = max(ans, j-i)

print(ans * 2)

Solution (Python):
n = list(input())
m = len(n)

for i in range(m):
    del n[-1]
    if len(n)%2 == 0:
        if n[0:(len(n)//2)] == n[(len(n)//2):(len(n)+1)]:
            print(len(n))
            break
    else:
        continue

Solution (Python):
s = input()
for i in range(len(s)):
    s = s[:len(s)-1]
    if len(s)%2 ==0:
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            break

Solution (Python):
S = list(input())
while S:
  del S[-2:]
  T = S[len(S)//2:]
  if T == S[:len(S)//2]:
    print(len(S))
    break

Solution (Python):
S = list(input())

for i in range(-1, -len(S), -1):
    S1 = S[:i]
    
    if len(S1) % 2 != 0:
        continue
    l = len(S1)//2
    if S1[:l] == S1[l:]:
      
      print(len(S1))
      break

Solution (Python):
s = input()[:-2]
while not s[0:len(s)//2] == s[len(s)//2:]:
    s = s[:-2]
    c = len(s)//2
print(len(s))

Solution (Python):
import sys
import copy
import  math
import bisect
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
ans = 1
for i in range(2, len(s), 2):
    c = s[:-i]
    l = len(c)
    if c[:l//2] == c[l//2:]:
        ans = max(l, ans)
print(ans)

Solution (Python):
S = input()

ans = 0
for i in range(1,len(S)):
  if S[:(i+1)//2] == S[(i+1)//2:i]:
    ans = i
  

print(ans)

Solution (Python):
s = list(input())
while True:
   s.pop()
   if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]:
       print(len(s))
       break

Solution (Python):
s = input()
l = len(s)
h = l//2
if l == 3:
    print(1)
if l%2==0:
    for i in range(1,h):
        if s[:h-i] == s[h-i:-2*i]:
            print(len(s[:-2*i]))
            break
else:
    for i in range(1,h):
        if s[0:h-i+1] == s[h-i+1:-2*i+1]:
            print(len(s[:-2*i+1]))
            break

Solution (Python):
s = list(input())
while True:
    s.pop()
    if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]:
        print(len(s))
        exit()

Solution (Python):
s = input()
l = len(s)
h = l//2
if l == 3:
    print(1)
if l%2==0:
    for i in range(1,h):
        if s[0:h-i] == s[h-i:-2*i]:
            print(len(s[:-2*i]))
            break
else:
    for i in range(1,h):
        if s[0:h-i+1] == s[h-i+1:-2*i+1]:
            print(len(s[:-2*i+1]))
            break

Solution (Python):
s = input()
l = len(s)
h = l//2
if l%2==0:
    for i in range(1,h):
        if s[0:h-i] == s[h-i:-2*i]:
            print(len(s[:-2*i]))
            break
else:
    for i in range(1,h):
        if s[0:h-i+1] == s[h-i+1:-2*i+1]:
            print(len(s[:-2*i+1]))
            break

Solution (Python):
s=input()
for i in range(len(s)-2,0,-2):
    if sum([s[i//2+j]!=s[j] for j in range(i//2)])==0:
        print(i)
        break

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

s = input()[:-1]


def isGu(st):
    if (len(st) % 2 != 0):
        return False
    flag = True
    for i in range(len(st) // 2):
        if (st[i] != st[i + len(st) // 2]):
            
            flag = False
    return flag


for i in range(2, len(s), 2):
    if (isGu(s[:-i])):
        print(len(s[:-i]))
        exit()
print(0)

Solution (Python):
def test():
    s = input()
    result = 0
    for i in range(len(s)-1):
        str = s[:i]
        if len(str) % 2 == 0:
            str1 = str[:len(str)//2]
            str2 = str[len(str)//2:]
            if all(str1[j] == str2[j] for j in range(len(str1))):
                result = max(result,len(str))
    print(result)


if __name__ == "__main__":
    test()

Solution (Python):
s=input()
l=len(s)
for _ in range(l):
  s=s[:-1]
  if(len(s)%2==1):
    continue
  if(s[:len(s)//2]*2==s):
    print(len(s))
    break

Solution (Python):
S =input()
del_flag = False
while True:
    if len(S) % 2 == 0 and del_flag == True:
        if S[:len(S)//2] == S[len(S)//2:len(S)]:
            print(len(S))
            exit()
    S = S[:len(S)-1]
    del_flag = True

Solution (Python):



S = input()


for i in range(len(S)):
    S = S[:-1]
    if len(S) % 2 == 0 and S[:int(len(S)/2)] == S[int(len(S)/2):]:
        break


print(len(S))

Solution (Python):
S = input()

L = len(S)

for l in range(L//2-1, -1, -1):
    if S[:l] == S[l:2*l]:
        print(2*l)
        break

Solution (Python):
s = input()

for i in reversed(range(1, len(s)//2)):
    if s[:i] == s[i:2*i]:
        ans = i * 2
        break

print(ans)

Solution (Python):
S = input().strip()
for i in range(1, len(S)):
  if (len(S)-i)%2 == 1: continue
  th = (len(S)-i)//2
  if S[:th] == S[th:-i]:
    print(len(S)-i)
    exit()

Solution (Python):
s = list(input())
s.pop()
s.pop()
while s[0:len(s)//2]*2 != s:
    s.pop()
    s.pop()
print(len(s))

Solution (Python):
S=input()

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

Solution (Python):
S = input()
while True:
    S = S[:-1]
    l = len(S)
    if S[:l//2]*2 == S:
        print(l)
        break

Solution (Python):
s = input()
n = len(s)
ret = ''
for i in range(n - 1, 0, -1):
    if len(s[:i]) % 2 == 1:
        continue
    
    if s[:i // 2] == s[i // 2:i]:
        ret = s[:i]
        break
print(len(ret))

Solution (Python):
s=input()
for i in range(1,len(s)):
    if i%2:
        continue
    if s[:i]==s[:i//2]*2:
        ans=i
print(ans)

Solution (Python):
s=list(input())
while len(s)!=0:
    s.pop()
    if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]:
        print(len(s))
        exit()

Solution (Python):
S = input()
S = S[:-1]
if len(S)%2==1:
  S = S[:-1]
l = len(S)
while(True):
  if S[:l//2] == S[l//2:]:
    break
  S = S[:-1]
  S = S[:-1]
  l -= 2
print(l)

Solution (Python):
s = input()
for i in range(len(s)-1,0,-1):
    if s[:int(i/2)]*2 == s[:i]:
        print(len(s[:i]))
        break

Solution (Python):
s = input()
n = len(s)//2

for i in range(1,n):
    if s[:n-i]==s[n-i:2*(n-i)]:
        print(2*(n-i))
        break

Solution (Python):
def main():
    S = input()
    for l2 in range(len(S)-1, 0, -1):
        if l2 % 2 == 0:
            l = l2 // 2
            if S[:l] == S[l:2*l]:
                return l2
    return -1


if __name__ == '__main__':
    print(main())

Solution (Python):
s = input()
s = s[0:-1]
for i in range(len(s)):
    for j in range(len(s)//2):
        if len(s)%2 ==1:
            s = s[0:-1]
            break
        elif s[j] != s[len(s)//2+j]:
            s= s[0:-1]
            break
print(len(s))

Solution (Python):
s = input()
n = len(s)

def solve():
    for i in range(n - 2, 0, -2):
        if s[:(i//2)] == s[(i//2):i]:
            print(i)
            return
solve()

Solution (Python):
s = input()
while True:
    s = s[:-1]
    if len(s) % 2 == 1:
        continue
    if s[0:int(len(s)/2)] == s[int(len(s)/2):]:
        print(len(s))
        break

Solution (Python):
s = input()
while True:
  s = s[:-2]
  if s[:len(s)//2] == s[len(s)//2:]:
    print(len(s))
    exit()

Solution (Python):
s = list(input())
s.pop()
while s[:len(s)//2] != s[len(s)//2:]: s.pop()
print(len(s))

Solution (Python):
a=input()
n=len(a)//2
for i in range(1,n):
  if a[:n-i]==a[n-i:2*(n-i)]:
    print(2*n-2*i)
    break

Solution (Python):
S=input()
for i in range(len(S)-1,1,-1):
    if S[:i//2]*2==S[:i]:
        print(i)
        exit()

Solution (Python):
S = input()
for i in range(len(S) - 2, 0, -2):
    s = S[:i]
    n = len(s) // 2
    if s[:n] == s[n:]:
        print(i)
        exit()

Solution (Python):
s = list(input())
while True:
  s.pop()
  c = len(s)
  if s[:c//2] == s[c//2:]:
    print(c)
    exit()

Solution (Python):


S = input()

for i in range(len(S) - 1, 0, -1):
    if S[:i//2] == S[i//2:i]:
        print(i)
        exit()

Solution (Python):
s = input()
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m"\
        , "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

ans = 0
i = 1
while i * 2 < len(s):
  if s[:i] == s[i:2 * i]: ans = i * 2
  i += 1
print(ans)

Solution (Python):
s = input()
s = s[0:-2]
for _ in range(len(s)):
    h = len(s)//2
    if s[0:h] == s[h:]:
        print(len(s))
        break
    else:
        s = s[0:-2]

Solution (Python):
s=list(input())
while True:
    s.pop(-1)

    l=len(s)
    if l%2==0 and s[0:l//2]==s[l//2:l]:
        print(l)
        break

Solution (Python):
s = input()
ans = 0
for i in range(len(s))[::-1]:
    cur = s[:i]
    cur_len = len(s[:i])
    if not cur_len&1 and cur[:cur_len//2] == cur[cur_len//2:]:
        ans = cur_len
        break
print(ans)

Solution (Python):
S = input()
for i in range(2, len(S), 2):
  l = (len(S)-i)//2
  if S[0:l] == S[l:2*l]:
    print(2*l)
    exit()

Solution (Python):
s = input()[:-1]
while s[:len(s)//2] != s[len(s)//2:]:
  s = s[:-1]
print(len(s))

Solution (Python):
s = input()[:-1]
while s[:len(s)//2] != s[len(s)//2:]:
  s = s[:-1]
print(len(s))

Solution (Python):
s = list(input().rstrip())
while len(s)>0:
  
  s.pop()
    
  n = len(s)//2
  
  if s[:n] == s[n:] and len(s) % 2 == 0:
    print(len(s))
    break

Solution (Python):
s=input()
l = len(s)
while(True):
    s = s[:int(l-2)]
    l -= 2
    if(s[:int(l/2)] == s[int(l/2):]):
        print(l)
        break

Solution (Python):



import sys
input = sys.stdin.readline


def main():
    s = str(input()).replace("\n", "")

    for i in range(len(s) - 2, 0, -2):
        s_new = s[:i]
        if s_new[:int(len(s_new)/2)] == s_new[int(len(s_new)/2):]:
            print(len(s_new))
            return


if __name__ == '__main__':
    main()

Solution (Python):
s=input()
s=s[:-2]

while True:
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        break
    
    s=s[:-2]

Solution (Python):
S = input()

for i in range(len(S)-2,0,-2):
  
  if S[0:i//2]==S[i//2:i]:
    print(i)
    break

Solution (Python):
s = input()

while True:
    s = s[:-1]
    if len(s) % 2 == 1:
        continue

    s1 = s[0:int(len(s) / 2)]
    s2 = s[int(len(s) / 2):]
    if s1 == s2:
        print(len(s))
        exit()

Solution (Python):
s=input()

def even():
  for i in range(2, len(s)+1, 2):
    l=int((len(s)-i)/2)
    if s[:l]==s[l:2*l]:
      return l*2

print(even())

Solution (Python):
S = input()

for i in range(2, len(S), 2):
  tmp = S[:-i]
  
  if tmp[:(len(tmp)//2)] == tmp[(len(tmp)//2):]:
    print(len(tmp))
    break

Solution (Python):
s = input()
ans = len(s)

if ans % 2 == 1:
    ans -= 1
else:
    ans -= 2

while ans > 0:
    if s[0:(ans//2)] == s[(ans//2):ans]:
        print(ans)
        exit()
    ans -= 2

Solution (Python):
s=input()

for i in range(len(s)//2):
    l=len(s)-2*i-2
    
    
    
    if s[:l//2]==s[l//2:l]:
        print(l)
        break

Solution (Python):
S = input()
l = len(S)
for i in range(1,l-1):
  s = S[0:l-i]
  ls = len(s)
  if ls%2 == 0 and s[0:int(ls/2)] == s[int(ls/2):ls]:
    break
print(ls)