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):
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right


from functools import reduce
from pprint import pprint

INF = float("inf")

def myinput():
    return map(int,input().split())

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

S = input()
S = S[:len(S)-1]

while len(S)!=0:
    l = len(S)
    if l%2==0:
        n = l//2
        A = S[:n]
        B = S[n:]
        
        if A==B:
            print(l)
            exit()
        else:
            S = S[:l-1]
    else:
        S = S[:l-1]
print("Error")

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

s = input().rstrip()
ans = 0
for i in range(1, len(s)):
    if i % 2 == 1:
        continue
    s_ = s[:len(s) - i]
    
    if s_[:len(s_)//2] == s_[len(s_)//2:]:
        ans = len(s_)
        break
print(ans)

Solution (Python):
s = input()

i = 0
while True:
    i += 1
    now = s[:-2*i]
    n = len(now)
    if now[:n//2] == now[n//2:]:
        break

print(n)

Solution (Python):
S=input()
N=len(S)
for d in range(1,N-1):
    if (N-d)&1: continue
    h=(N-d)//2
    for i in range(h):
        if S[i]!=S[i+h]: break
    else:
        print(N-d)
        exit()

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    S=readline().strip()
    N=len(S)

    for n in range(N-1,-1,-1):
        if n%2==1:
            continue
        else:
            if S[:n//2]==S[n//2:n]:
                print(n)
                break
if __name__=="__main__":
    main()

Solution (Python):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
import bisect










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

def readInts():
  return list(map(int,input().split()))
def main():
    S = input()
    sl = len(S)
    S = S[:-1]
    sl -= 1
    while True:
        if sl % 2 != 0:
            S = S[:-1]
            sl -= 1
        else:
            if S[:sl//2] == S[sl//2:]:
                print(sl)
                exit()
            else:
                S = S[:-1]
                sl -=1
if __name__ == '__main__':
  main()

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().strip()
N = len(S)
for i in range(2,N,2):
    x = S[:-i]
    y = x[:(N-i)//2]
    z = x[(N-i)//2:]
    if y==z:
        print(N-i)
        break

Solution (Python):
s = input()
n = len(s)
def check(x):
    p = len(x)
    a = x[:p//2]
    b = x[p//2:]
    return a == b
for i in range(n-2,-1,-1):
    if check(s[:i+1]):
        print(len(s[:i+1]))
        break

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

S = input()[:-1]

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

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

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

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

print(len(s))

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

Solution (Python):
S = input()

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

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

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

while s:
    s.pop()
    s.pop()
    n = len(s)
    if s[:n//2] == s[n//2:]:
        print(n)
        break

Solution (Python):
def main():
    S = input()
    N = len(S)
    for i in range(1, N+1):
        t = S[:-i]
        if len(t) % 2 == 1:
            continue
        M = len(t)
        if t[:M//2] == t[M//2:]:
            return print(M)


if __name__ == '__main__':
    main()

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

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

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

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

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

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

    dp = [[0] * (n + 1) for _ in range(n + 1)]
    for j in reversed(range(n)):
        for i in reversed(range(j)):
            if s[i] == s[j]:
                dp[i][j] = min(
                    dp[i + 1][j + 1] + 1,
                    j - i
                )
            else:
                dp[i][j] = 0

    ans = max(x * 2 for x in dp[0] if x * 2 < n)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Solution (Python):

Max_even = 0
def evenserch(S):
    global Max_even
    
    f=0
    if(len(S) == 0):
        return Max_even
    else:
        S.pop()
        if(len(S)%2 == 1):
            return evenserch(S)
        else:
            for i in range(int(len(S)/2)):
                
                if(S[int(len(S)/2)+i]!=S[i]):
                    f = 1
                    break
            if(f==0):
                if(Max_even < len(S)):
                    Max_even = len(S)
            return evenserch(S)
def main():
    S = list(map(str,input()))
    k = evenserch(S)
    print(k)

if __name__ == '__main__':
    main()

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

for i in range(lens):
    for j in range(lens - i):
        left = s[0: j + 1]
        right = s[j + 1: lens - i]
        left = ''.join(left)
        right = ''.join(right)
        if left == right and i != 0:
            print(len(left)+len(right))
            exit()

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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    S = readstr()
    ans = 0
    for i in range(0, len(S)):
        s = S[:i]
        if s * 2 in S and s * 2 != S:
            ans = len(s * 2)

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
S=input()
N=len(S)
ans=S[0]
for i in range(1,N):
    if i%2==1:
        continue
    T=S[:i]
    T1=T[:i//2]
    T2=T[i//2:]
    if T1==T2:
        ans=T
        
print(len(ans))

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
S = input()

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

Solution (Python):
s = input()
s = s[:-2]
while True:
    n = len(s)
    if s == s[:n//2]*2 and s == s[n//2:]*2:
        print(n)
        break
    s = s[:-2]

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
S = input()

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

Solution (Python):
import sys













ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    s = input()

    l = len(s)
    for i in range(1, l):
        if (l-i) % 2 == 1:
            continue
        front = s[:(l-i) // 2]
        rear = s[(l-i) // 2:-i]

        if front == rear:
            print(l-i)
            exit(0)


if __name__ == '__main__':
    main()

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

def judge(s):
    if len(s)%2 == 1:
        return 0
    else:
        for i in range(int(len(s)/2)):
            if s[i]!=s[int(len(s)/2)+i]:
                return 0
        return 1

    
x = len(S)
for i in range(1,len(S)):
    S = S[:-1]
    if judge(S)== 1:
        print(x-i)
        break

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
S = input()

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

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

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

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().strip()
N = len(S)
for i in range(2,N,2):
    x = S[:-i]
    if x[:(N-i)//2]==x[(N-i)//2:]:
        print(N-i)
        break

Solution (Python):
def main():
    from collections import deque
    s = deque(list(input()))
    while deque:
        t = s.pop()
        if len(s)%2 != 0:
            continue
        l = list(s)
        if l[:len(l)//2] == l[len(l)//2:]:
            print(len(l))
            return 0

if __name__ == '__main__':
    main()

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

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

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    S = list(input())
    S.pop()
    while len(S) != 1:
        n = len(S)
        if n % 2 == 0:
            if S[: n // 2] == S[n // 2:]:
                break
        S.pop()

    print(len(S))


if __name__ == '__main__':
    resolve()

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

s = STR()
l = len(s)
for i in reversed(range(1, (l - 1) // 2 + 1)):
    if s[:i] == s[i:2 * i]:
        print(i * 2)
        exit()

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

while s:
    s.pop()
    s.pop()
    n = len(s)
    if s[:n//2] == s[n//2:]:
        print(n)
        break

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


if __name__ == '__main__':
    main()

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

N = len(S) - 1

n = N // 2

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

Solution (Python):
s = list(input())
for i in range(len(s)):
    s.pop()
    t = len(s)
    if t % 2 == 0 and s[:t // 2] == s[t // 2:]:
        print(t)
        break

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


def solve(S):
    
    r = N % 2
    for i in range(1, N//2):
        s = S[:N-(2*i+r)]
        n = len(s)
        
        if s[:(n//2)] == s[(n//2):]:
            ans = N - (2 * i + r)
            break
    return ans


print(solve(S))

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,sqrt
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 printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7


def guu(s):
    return 1 if s[0:len(s)//2]==s[len(s)//2:] else 0
t=input().rstrip()
i=2
while i<len(t):
    
    if guu(t[0:i])==1:
        mx=i
    i+=2
print(mx)

Solution (Python):
import sys
from io import StringIO
import unittest


def resolve():
    s = list(input())
    ll = len(s)
    ans = 0

    if ll % 2 == 0:
        for i in range(0, ll, 2):
            if i == 0:
                if s[:ll//2+1] == s[ll//2 + 1:]:
                    ans = ll//2
                    break
            else:
                tmp = s[:(-1 * i)]
                if tmp[:len(tmp)//2] == tmp[len(tmp)//2:]:
                    ans = len(tmp)
                    break
    else:
        for i in range(1, ll, 2):
            tmp = s[:-i]
            if tmp[:len(tmp)//2] == tmp[len(tmp)//2:]:
                ans = len(tmp)//2
                break
    print(ans)

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """abaababaab"""
        output = """6"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """xxxx"""
        output = """2"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """abcabcabcabc"""
        output = """6"""
        self.assertIO(input, output)
    def test_入力例_4(self):
        input = """akasakaakasakasakaakas"""
        output = """14"""
        self.assertIO(input, output)

if __name__ == "__main__":
    
    resolve()

Solution (Python):
s = list(input())
for i in range(len(s)):
    s.pop()
    t = len(s)
    if t % 2 == 0 and s[:t // 2] == s[t // 2:]:
        print(t)
        break

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

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

s = input()
n = len(s)
j = 1
while True:
    c = ""
    for i in range(n-j):
        c += s[i]
    if len(c)%2 == 0:
        d = ""
        f = ""
        for i in range(len(c)//2):
            d += c[i]
            f += c[len(c)//2 + i]
        if d == f:
            print(len(c))
            sys.exit()
    j += 1

Solution (Python):
S=list(input())
S=S[:-2]


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

for i in reversed(range(0,len(S)+1,2)):
  
  if isDouble(S[:i]):
    print(i)
    break

Solution (Python):

s = list(input())
for i in range(len(s)):
    s.pop()
    t = len(s)
    if t % 2 == 0 and s[:t // 2] == s[t // 2:]:
        print(t)
        break

Solution (Python):
S=input()
flag=0
chara=S
def hantei(moji):
    global flag
    
    length=len(moji)
    
    flag=0
    
    
    
    if moji[0:length//2]==moji[(length//2):]:
        flag=1
        
        return 
    else:
        flag=0
        return 
    
while flag==0:
    
    chara=chara[:-1]
    hantei(chara)
    
print(len(chara))

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

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

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x, 'b') 
def to_oct(x: int) -> str: return format(x, 'o') 
def to_hex(x: int) -> str: return format(x, 'x') 
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]

from itertools import accumulate as acc, combinations as combi, product, combinations_with_replacement as combi_dup
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left


def main():
    s = IS()
    n = len(s)
    for i in range(2,n,2):
        si = s[:n-i]
        sl = si[:(n-i)//2]
        sr = si[(n-i)//2:]
        if sl == sr:
            print(n-i)
            return None

if __name__ == '__main__':
    main()

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

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

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

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

for i in range(len(S)):
    
    
    if (i == 0):
        S = S[1:]
        continue
    if (len(S) % 2 == 0):
        if (S[0:len(S) // 2] == S[len(S) // 2:]):
            print(len(S))
            break
        else:
            S = S[1:]
    else:
        S = S[1:]

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

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

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

for i in range(1, len_S):
    partial_S = S[:-i]
    len_partial_S = len(partial_S)
    if len_partial_S % 2 != 0:
        continue
    hf = int(len_partial_S / 2)
    if ''.join(partial_S[:hf]) == ''.join(partial_S[hf:]):
        print(len_partial_S)
        break

Solution (Python):
s = list(input())
ss = s[::]

for i in range(len(s)):
	if len(ss) == 1:
		break
		
	ss.pop()
	if len(ss) % 2 == 0:
		n = len(ss) // 2
		if ss[:n] == ss[n:]:
			break

if len(ss) == 1:
	print(-1)
else:
	print(len(ss))

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


def read():
    S = input().strip()
    return S,


def solve(S):
    N = len(S)
    for i in range(N // 2 - 1, 0, -1):
        a0 = 0
        a1 = i
        b0 = i
        b1 = i + i
        if S[a0:a1] == S[b0:b1]:
            return b1
    return 0


if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))

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

Solution (Python):
moji = str(input())
cnt = 0
while len(moji)!=0:
  lst = list(moji)
  del lst[-1]
  cnt += 1
  moji = ''.join(lst)
  if len(moji)%2==0:
    centre = int(len(moji)/2)
    if lst[0:centre] == lst[centre:len(lst)+1]:
      print(len(lst))
      break;

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

while n > 1:
    n = len(S)
    S = S[:n-1]
    if len(S)%2 != 0:
        continue
    m = len(S)//2
    x = S[:m]
    y = S[m:]
    if x == y:
        n =len(S)
        break

print(n)

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

Solution (Python):
S = input()

while True:
    S = S[:-2]
    N = len(S)
    if S[:N // 2] == S[N // 2:]:
        print(N)
        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]:
        ans = len(S)-i
        break
print(ans)

Solution (Python):
def resolve():
	s = input()
	ans = 0
	for i in range(len(s)-1, 1, -1):
		if len(s[:i]) % 2:
			next
		else:
			if s[:i//2] == s[i//2:i]:
				ans = max(ans, len(s[:i]))
	print(ans)
resolve()

Solution (Python):
S = input()
a = (len(S) - 1) // 2 * 2

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    S = input()
    while True:
        S = S[:-2]
        L = len(S)
        if S[:L//2] == S[L//2:]:
            print(L)
            break



if __name__ == '__main__':
    main()

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

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

Solution (Python):
S = input()

while True:
  S = S[:-1]
  if len(S) % 2 ==1:
    continue
  elif S[0:len(S)//2] == S[len(S)//2:]:
    print(len(S))
    break

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

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

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

Solution (Python):
s=input()
l=len(s)
a=0
while a==0:
  l-=2
  if s[:l//2]==s[l//2:l]:
    a=1
print(l)

Solution (Python):
def func(s):
    n = len(s)//2
    left = s[:n]
    right = s[n:]
    if left == right:
        return True
    else:
        return False

s = list(input())
m = len(s)
for i in range(2,m,2):
    if func(s[:m-i]):
        print(m-i)
        break

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

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