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):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
lens = len(s)
for i in range(2, lens, 2):
  if s[:(lens - i) // 2] == s[(lens - i) // 2:lens - i]:
    print(lens - i)
    exit()

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

Solution (Python):









s = input()

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

Solution (Python):
def solve():
    S = input()
    for _ in range(len(S)):
        S = S[:-2]
        if S[:len(S) // 2] == S[len(S) // 2:]:
            print(len(S))
            exit()


if __name__ == "__main__":
    solve()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()


def main():
    s = input()
    l = len(s)
    ans = l - 2
    for i in range(2, l):
        if i % 2 != 0: continue
        ns = s[:l-i]
        even = True
        for j, c in enumerate(ns):
            if j >= (l - i) // 2: break
            if c != ns[(l - i) // 2 + j]:
                even = False
                break
        if even:
            ans = l - i
            break
    print(ans)


if __name__ == "__main__":
    main()

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

Solution (Python):
s=input()
n=len(s)
for i in range(1,n//2-1):
    m=n//2-i

    x=s[0] 
    for j in range(m-1):
        x=x+s[j+1]
    y=s[m]
    for j in range(m-1):
        y=y+s[m+1+j]

    if x==y:
        print(2*m)
        exit()
print(2)

Solution (Python):
s = input()

ans = 0
for i in range(1, len(s)):
  tmp_s = s[: - i]
  tmp_N = len(tmp_s)
  if tmp_N % 2 == 1:
    continue
  tmp_s_l = tmp_s[:tmp_N//2]
  tmp_s_r = tmp_s[tmp_N//2:]
  if tmp_s_l == tmp_s_r:
    ans = tmp_N
    break

print(ans)

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

Solution (Python):
def resolve():
    S = input()
    for i in range(len(S)-1):
        S = S[:-1]
        if len(S)%2 == 0 and S[:len(S)//2] == S[len(S)//2:]:
            print(len(S))
            exit()
resolve()

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

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

Solution (Python):
s = input()
if len(s) % 2 == 1:
    s += "."

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

Solution (Python):
s = input()

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

while(s != ""):
    l = len(s)//2
    if(s[:l] == s[l:]):
        print(l*2)
        break
    s = s[:-2]

Solution (Python):
s = input()

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

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

Solution (Python):
l = list(input())
while len(l) > 0:
    l = l[:-2]
    if l[:len(l)//2] == l[len(l)//2:]:
        print(len(l))
        exit()

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

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

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


def main():
  S = input()[:-1]

  dl = 2
  while dl < len(S):
    center = (len(S) - dl) // 2
    if S[:center] == S[center:-dl]:
      print(len(S)-dl)
      return
    dl += 2


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):
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

def main():
    S = input()

    ans = 0
    for i in range(len(S)):
        S_tmp = S[:-i-1]
        if len(S_tmp)%2 != 0:
            continue
        ci = len(S_tmp)//2
        if S_tmp[:ci] == S_tmp[ci:]:
            ans = max(ans, len(S_tmp))
    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):
s = input()

end = len(s) - 1
half = int(len(s) / 2) - 1
flag = True
while end != 1:
    end -= 2
    half -= 1
    start = 0
    flag = True
    for i in range(half+1, end):
        if s[i] != s[start]:
            flag = False
            break
        start += 1
    if flag == True:
        print(end+1)
        exit()

Solution (Python):
S = input()

n = len(S)
m = n // 2 if n % 2 == 1 else n//2 - 1

for w in range(m,0,-1):
    for i in range(w):
        if S[i] != S[i+w]:
            break
    else:
        print(2*w)
        break

Solution (Python):
s = input()

end = len(s) - 1
half = int(len(s) / 2) - 1
flag = True
while end != 1:
    end -= 2
    half -= 1
    start = 0
    flag = True
    for i in range(half+1, end):
        if s[i] != s[start]:
            flag = False
            break
        start += 1
    if flag == True:
        print(end+1)
        exit()

Solution (Python):
S = input()

start = 2
if len(S) % 2:
    start = 1

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

Solution (Python):
S = input()

N = len(S)

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

Solution (Python):
S = str(input())
N = len(S)
for i in range(1,N):
  T = S[:N-i]
  M = len(T)
  if M%2 != 0:
    continue 
  if T[:M//2] == T[M//2:]:
    print(M)
    exit()

Solution (Python):
S = input().strip()
cnt = 0
for i in range(len(S)-3,-1,-2):
    if S[:(i+1)//2]==S[(i+1)//2:i+1]:
        cnt = (i+1)
        break
print(cnt)

Solution (Python):
s = list(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):
import math
S = str(input())
S=S[0:len(S)-1]
 
if len(S)%2!=0:
	S=S[0:len(S)-1]
 
for i in range (0, int(len(S)/2)):
	N = len(S)
	if S[0:int(N/2)] == S[int(N/2)::]:
		print(2*len(S[0:int(N/2)]))
		exit()	
	else:
		S=S[0:N-2]

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

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

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

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

Solution (Python):
S = input()
N = len(S) // 2
for i in reversed(range(N)):
  if S[0:i] == S[i:2*i]:
    print(2*i)
    break

Solution (Python):
s = input()
ans =0
n = len(s)
for i in range(1 , n):
	f=0
	for j in range(0 , i-1):
		if j+i>=n or s[j]!=s[i+j]:
			f=1
	if f==0:
		if n-2*i!=0:
			ans = max(ans, 2*i)
print(ans)

Solution (Python):
s = input()
l = len(s)
for i in range(l):
    val = (l-i-1)
    if not val%2:
        sol = s[:val]
        if sol[:val//2]==sol[val//2:]:
            print(val);    break

Solution (Python):
s = input()

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

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

Solution (Python):
s = input()

l = len(s)

if l%2 ==1: 
    s = s[:-1]
else:
    s = s[:-2]



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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = readline().strip()
    N = len(S)

    for w in range(N // 2 - 1, 0, -1):
        ok = True
        for i in range(w):
            if S[i] != S[i + w]:
                ok = False
                break
        if ok:
            print(2 * w)
            return

    return


if __name__ == '__main__':
    main()

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def is_even(S):
    if len(S) % 2 != 0:
        return False
    if S[: len(S) // 2] == S[len(S) // 2 :]:
        return True
    else:
        return False


def main():
    S = readline().strip()
    S = S[:-1]

    for w in range(len(S), 0, -1):
        for i in range(len(S) - w + 1):
            if is_even(S[i : i + w]):
                print(w)
                return

    return


if __name__ == '__main__':
    main()

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

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

Solution (Python):
s = input()
len_s = len(s)
is_ok = False
while(is_ok == False):
    len_s -= 2
    word = s[:len_s]
    if word[:len_s // 2] == word[len_s // 2 :]:
        is_ok = True
    else:
        pass
print(len_s)

Solution (Python):
s = input()

if len(s) == 2:
  print(0)
else:
  for l in range(1,len(s)):
    s = s[:len(s)-1]
    if s[:len(s)//2] == s[len(s)//2:]:
      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))
        break

Solution (Python):
def solve():
  ans = 0
  S = input()
  n = len(S)
  for i in range(n//2-1,0,-1):
    if S[:i]==S[i:2*i]:
      return i*2
print(solve())

Solution (Python):






s = list(input())
n = len(s)


for i in range(n-1, 0, -1):
    s.pop()
    slen = len(s)
    
    if slen % 2 == 0:
        hs = slen // 2
        tflg = True
        for j in range(0, hs, 1):
            if s[j] != s[j+hs]:
                tflg = False
                break
        if tflg == True:
            ans = slen
            break


print(ans)

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
S = input()[:-1]
while len(S):
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        exit()
    S = S[:-1]

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


S = ins()


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


def solve():
    for i in range(len(S) - 1, 1, -1):
        s = S[:i]
        if is_even(s):
            return i
    return None


print(solve())

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 = list(str(input()))
for i in range(len(s)):
    s.pop()
    if len(s)%2 == 1:
        continue
    t = s[0:len(s)//2]
    u = s[len(s)//2:]
    t = ''.join(t)
    u = ''.join(u)
    if t == u:
        print(len(s))
        exit()

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

del s[:2]
l = len(s)

while any(s[i] != s[l//2 + i] for i in range(l//2)):
    del s[:2]
    l = len(s)

print(l)

Solution (Python):




import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return np.array(x)

S = input()

N = len(S)

List = []

for i in range(0,int(N/2)):
    List.append([S[0:i+1],S[i+1:2*i+2]])

del List[-1]

for a in List[::-1]:
    if a[0] == a[1]:
        print(2*len(a[0]))
        exit()

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

for i in range(2, n, 2):
    left = int((n-i)/2)
    tmp1 = s[0:left]
    tmp2 = s[left:n-i]
    if (tmp1 == tmp2):
        print(left * 2)
        break

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

Solution (Python):


S = input()[:-1]

if len(S) < 2:
    ans = 0

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

print(ans)

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

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

Solution (Python):
s=input()
n=len(s)
for i in reversed(range(n-1)):
    if i%2:
        l=s[:i//2+1]
        r=s[i//2+1:i+1]
        ok=True
        for j in range(i//2+1):
            if l[j]!=r[j]:
                ok=False
        if ok:
            print(i+1)
            exit()

Solution (Python):
from sys import exit

s = input()

for i in range(len(s)-1, -1, -1):
    if i % 2 == 1:
        continue

    flag = True
    for j in range(i // 2):
        if s[j] != s[i//2+j]:
            flag = False
    
    if flag:
        print(i)
        exit()

Solution (Python):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    s = input()
    len_s = len(s)
    for i in range(2, len_s-1, 2):
        len_s -= 2
        left = s[:len_s//2]
        right = s[len_s//2:len_s]
        if left == right:
            break
    print(len_s)

if __name__ == '__main__':
    main()

Solution (Python):
def is_even(s):
    if len(s) % 2 == 1:
        return False
    mid = len(s) // 2
    if s[:mid] == s[mid:]:
        return True
    return False

def main():
    S = input().strip()
    S = S[:len(S)-2]
    while len(S) > 2:
        if is_even(S):
            break
        else:
            S = S[:len(S)-2]
    print(len(S))

if __name__ == "__main__":
    main()

Solution (Python):
S = input()
res=0

def doubleCheck(moji):
  n = len(moji)//2
  if len(moji) % 2 ==1:
    return False
  else:
    if moji[0:n] == moji[n:len(moji)]:
      return True
    else:
      return False

for i in range(len(S)):
  S = S[0:len(S)-1]
  if doubleCheck(S):
    res = len(S)
    break
print(res)

Solution (Python):
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))
        exit()

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

for i in range(len(s)):
    s.pop()
    if len(s) % 2 != 0:
        continue
    if s[:int(len(s)/2)] == s[int(len(s)/2):]:
        print(len(s))
        break

Solution (Python):
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))
        exit()

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

for i in range(len(s)):
    if i == 0:
        s.pop()
    elif len(s) % 2 == 0:
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            break
        else:
            s.pop()
    else:
        s.pop()

Solution (Python):
S = input()

front_str = ''
back_str = ''
result = 0
for i in range(2, len(S)-1, 2):
    front_str = S[:int(i/2)]
    back_str = S[int(i/2):i]
    tmp_len = 0
    if front_str == back_str:
        tmp_len = i
        result = max(result, tmp_len)

print(result)

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

while n>1:
    
    if n%2==0:        
        s=s[:n]

        tmp1=s[:n//2]
        tmp2=s[n//2:]

        if tmp1==tmp2:
            print(n)
            exit(0)
    
    n-=1

Solution (Python):
def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()
    
    s = input()
    n = (len(s)-1)//2
    ans = 0
    for i in range(1,n+1):
        if (s[:i] == s[i:2*i]):
            ans = 2*i
    print(ans)




if __name__ == '__main__':
    main()

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

Solution (Python):
s = input()

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

Solution (Python):

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

Solution (Python):
s=input()
ans=0
for i in range(len(s)//2):
    t1=s[0:i]
    t2=s[i:2*i]
    if t1==t2:

        ans=max(ans,2*i)
print(ans)

Solution (Python):
M = input()
MM = list(M)
count = 0
x = len(MM)
while count == 0:
  if len(MM)%2 ==1:
    MM.pop(-1)
  else:
    a = int(len(MM)/2)
    
    if MM[:a] == MM[a:] and len(MM) != x:
        count =1
    else:
      MM.pop(-1)
print(len(MM))

Solution (Python):
s = input()
n = len(s)
idx = 1
while idx < n:
    sub_s = s[: n - idx]
    if sub_s == sub_s[: len(sub_s) // 2] * 2:
        break
    idx += 1

print(n - idx)

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

Solution (Python):
s = input()
for i in range((len(s) >> 1) - 1, -1, -1):
    n = i << 1
    if s[:i] == s[i:n]:
        print(n)
        break

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

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

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

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

Solution (Python):
def evenstr(x):
    box1 = []
    box2 = []
    if len(x) % 2 == 1:
        return False
    else:
        v = int(len(x) / 2)
        for i in range(v):
            box1.append(x[i])
        for i in range(v, len(x)):
            box2.append(x[i])
        if box1 == box2:
            return True
        else:
            return False

    

count = 0
s = input()
p = list(s)
p.pop()
count += 1

for i in range(len(p) - 2):
    if evenstr(p):
        break
    else:
        count += 1
    p.pop()

print(len(p))

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

Solution (Python):
s=input()

s=s[:len(s)-1]
l=len(s)
if l%2==0:
  for i in range(0,l+1,2):
    x=s[:l-i]
    if x[:len(x)//2] == x[len(x)//2:]:
      print(len(x))
      exit()
else:
  s=s[:len(s)-1]
  l=len(s)
  for i in range(0,l+1,2):
    x=s[:l-i]
    if x[:len(x)//2] == x[len(x)//2:]:
      print(len(x))
      exit()

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

Solution (Python):
s = input()

l = len(s)
ans = 0

for i in range(1 if l % 2 else 2, l, 2):
    t = s[:-i]
    tl = (l-i)//2

    if t[:tl] == t[tl:]:
        ans = tl*2
        break


print(ans)

Solution (Python):
import sys
S = input()[:-2]
while len(S) > 0:
    if S[:len(S) // 2] == S[len(S) // 2:]:
        print(len(S))
        sys.exit()
    S = S[:-2]

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

Solution (Python):
s = input()

n = -1
if len(s) % 2 == 0:
    n = -2
while len(s) > abs(n):
    hanbun = len(s[:n])//2
    if s[:hanbun] == s[hanbun:n]:
        print(len(s[:n]))
        break
    n -= 2

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

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

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

Solution (Python):
s = input()
ans = ''
while True:
  i = len(s)//2
  if s[0:i]==s[i:-1]:
    ans = s[0:i]+s[i:-1]
    break
  s = s[0:-1]
print(len(ans))

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

Solution (Python):
def is_even_str(s):
    l = len(s)
    if l % 2 != 0:
        return False
    return s[:l // 2] == s[l // 2:]


S = input()[:-2]
while not is_even_str(S):
    S = S[:-2]
print(len(S))

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

Solution (Python):
s = input()

for i in range(1,len(s)):
    tmp = s[:-i]
    if len(tmp) % 2 == 1:
        continue
    else:
        h = int(len(tmp)/2)
        if tmp[h:] == tmp[:h]:
            print(len(tmp))
            break

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

Solution (Python):
s = list(input())
while s:
    s = s[:-1]
    sl = len(s)
    if sl%2 == 0:
        s1 = s[0:sl//2]
        s2 = s[sl//2:]
        if s1 == s2:
            print(sl)
            break

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

ans = 0
while ans == 0:
    cnt = 0
    del s[-1], s[-1]
    for i in range(len(s)//2):
        if s[i] != s[i + len(s)//2]:
            break
        cnt += 1
    if cnt == len(s)//2:
        ans = len(s)

print(ans)

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

Solution (Python):
def main():
    s = input()

    bool = False
    l = len(s)

    while bool == False:
        l = l - 2
        if s[0:l//2] == s[(l+1)//2:l]:
            bool = True

    print(l)

        
if __name__ == '__main__':
    main()

Solution (Python):
S = input()

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


while len(S) > 0:	
	if S[0:int(len(S)/2)] == S[int(len(S)/2) : len(S)]:
		print(len(S))
		break
	S = S[0:len(S) - 2]

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

if len(s)%2==1:
    s=s[:-1]
while len(s)>=0:
    l=len(s)//2
    if s[:l]==s[l:]:
        break
    s=s[:-1]
    s=s[:-1]
print(len(s))

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

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

Solution (Python):
S = input()

def solve(S):
    for i in range(len(S)):
        S = S[:-1]
        if len(S) % 2 == 1:
            continue
        half = len(S) // 2
        if S[:half] == S[half:]:
            return len(S)

print(solve(S))

Solution (Python):
import sys

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

def solve():
    input = sys.stdin.readline
    S = list(input().strip("\n"))
    N = len(S)
    S.pop()
    for i in range(N):
        if doubleS(S):
            print(N - i - 1)
            break
        S.pop()
    else: print(0)

    return 0

if __name__ == "__main__":
    solve()

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

Solution (Python):
S = input()
ans = 0
i = 1
while i * 2 < len(S):
  l = S[:i]
  r = S[i:i*2]
  if(l == r):
    ans = i * 2
  i += 1
print(ans)

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

ans  = -1
for i in range(1, N):
    T = S[:i]
    if len(T)%2 != 0: continue
    if T[:i//2] == T[i//2:]:
        ans = i
print(ans)

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

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

Solution (Python):
s = input()

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

Solution (Python):
s=list(input())
s=s[:-2]
while s:
    n=len(s)//2
    p=s[:n]
    q=s[n:]
    if p==q:
        print(2*n)
        break
    else:
        s=s[:-2]

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




def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
	s=input().rstrip().decode()

	n=len(s)

	for i in range(2,n,2):
		
		if s[:(n-i)//2]==s[(n-i)//2:n-i]:
			print(n-i)
			exit()













if __name__ == "__main__":
	main()

Solution (Python):
s = str(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 = input()

index = len(S)-2

while index>0:
    half = index // 2
    if S[:half] == S[half:index]:
        break
    index -= 2

print(index)

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

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re











import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
S = input()
lnS = len(S)
for i in range(lnS-1,-1,-1):
    
    S = S[:i]
    flag = True
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        exit()

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

Solution (Python):






import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

s=SI()
n=len(s)
for i in range(n-2,0,-2):
    u=s[:i]
    
    if u[:i//2]==u[i//2:]:
        
        print(i)
        sys.exit()

Solution (Python):
S = input().strip()
N = len(S)
for i in range(N//2-1,0,-1):
    if S[:i]==S[i:2*i]:
        ans = i
        break
print(ans*2)

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

Solution (Python):
s=input()
length=len(s)
now_length=length-2
ans=0
while True:
    if s[0:int(now_length/2)]==s[int(now_length/2):now_length]:
        ans=now_length
        break
    else:
        now_length=now_length-2
print(ans)

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

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

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

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

Solution (Python):
s = list(input())
if len(s) % 2 != 0:
    s.pop(-1)

l = len(s) // 2 - 1
while True:
    t = 0
    for i in range(l):
        if s[i] == s[l + i]:
            t += 1
    if t == l:
        print(t * 2)
        exit(0)
    else:
        l -= 1

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

Solution (Python):
S=input()


for i in range(1,len(S)):
    s=S[:-1*i]
    if len(s)%2==0:
        head=s[:len(s)//2]
        tail=s[len(s)//2:]
        if head==tail:
            print(len(s))
            break
        else:
            pass
    else:
        continue