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 = input()
n = len(s)

for i in range(2, n, 2):
  flag = 1
  for j in range(n-i-1, int((n-i)/2-1),-1):
    if s[j] != s[j-int((n-i)/2)]:
      flag = 0
      break
  if flag == 1:
    break
    
print(n-i)

Solution (Python):
s = str(input())
ans = 0

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

    if s[0:i//2] == s[i//2:i] and i > ans :
        ans = i
    elif i <= ans:
        break

if len(s)==2:
    ans = 2
print(ans)

Solution (Python):
S = input()

l = len(S)

l = (l-2)//2
while l > 0:
    if S[0:l] == S[l:2*l]:
        print(2*l)
        break
    l = l-1

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

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

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

Solution (Python):
def answer(s: str) -> int:
    if len(s) % 2 == 1:
        s += ' '

    for _ in range(len(s) // 2):
        s = s[:-2]
        l = len(s)
        middle = l // 2

        if s[:middle] == s[middle:]:
            return l


def main():
    s = input()
    print(answer(s))


if __name__ == '__main__':
    main()

Solution (Python):
S=input()

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

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

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

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

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

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

ans = n

for i in range(n):
    s = s[0:-1]
    ans -= 1

    if s[0:ans//2] == s[ans//2:]:
        break

print(ans)

Solution (Python):
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

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

def run():
    S = list(input())

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

    for target_len in range(len(S) - 1, 1, -1):
        if target_len % 2 == 0:
            mid = target_len // 2
            first = S[:mid]
            second = S[mid:mid + mid]

            if first == second:
                print(target_len)
                return

run()

Solution (Python):
s = input()

length = 0
if len(s) % 2 == 0:
  length = len(s) // 2 - 1
else:
  length = len(s) // 2

top = -1

for i in range(length):
  flag = True
  for j in range(i):
    if s[j] != s[i + j + 1]:
      flag = False
  if flag :
    top = (i+1) * 2

print(top)

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):
def judge(Str, Len):
  if Str[:Len//2] == Str[Len//2:]:
    return True
  else:
    return False

S = input()
L = len(S)
i = 2 - (L % 2)
S = S[:-i]
L -= i
if judge(S, L):
  print(L)
else:
  while not judge(S, L):
    S = S[:-2]
    L -= 2
  print(L)

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

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

ans = []

for i in range(len(s)):
  tmp = s[0:len(s)-(i+1)]
  
  if tmp[0:int(len(tmp)/2)] == tmp[int(len(tmp)/2):len(tmp)] and len(tmp)%2 == 0:
    ans.append(len(tmp))
    
print(max(ans))

Solution (Python):
import sys
S = input()

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

Solution (Python):



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

def check(S):
    half = len(S) // 2
    if S[:half] == S[half:]:
        return True
    else:
        return False

while True:
    if check(S):
        print(len(S))
        break
    S = S[:-2]

Solution (Python):
import sys
S = input()

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

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

Solution (Python):
s = input()

def judge(S):
   if (len(S) % 2 == 0) and (S[:len(S) // 2] == S[(-1) * len(S) // 2:]):
      return True
   else:
      return False

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

Solution (Python):

def main():
    s = list(input())

    for _ in range(len(s)):
        s.pop()
        if len(s) % 2 == 0:
            p = len(s)//2
            if s[0:p] == s[p:]:
                print(len(s))
                exit()


if __name__ ==  "__main__":
    main()

Solution (Python):
S = str(input())
for i in range(1, int(len(S) / 2)):
    T = S[0: len(S) - 2 * i]
    clear = 0
    m = int(len(T) / 2)
    for j in range(m):
        if T[j] == T[m + j]:
            clear += 1
    if clear == m:
        print(len(T))
        break

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

if len(s) == 2:
    print(0)
    sys.exit(0)

for i in range(1, len(s) // 2 + 1):
    split_index = (len(s) - i * 2) // 2
    if s[:split_index] == s[split_index:len(s) - i * 2]:
        print(len(s) - i * 2)
        sys.exit(0)

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

Solution (Python):
s = input()
for i in range(len(s)):
    s = 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())


import sys
for i in range(len(S)):
    del S[-1]
    for j in range(len(S)):
        if len(S)%2==0:
            if S[0:len(S)//2]==S[len(S)//2:len(S)]:
                print(len(S))
                sys.exit()
else:
    print(0)

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

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

for i in range(2, len(S)):
    miniS = S[0:-i]
    if len(miniS) % 2 == 0:
        front = ''.join(miniS[0:len(miniS)//2])
        back = ''.join(miniS[len(miniS)//2:len(miniS)])
        if front == back:
            print(len(miniS))
            exit()

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

S=input().strip()

N = len(S)//2
i = 0
while True:
    i += 1
    a = S[0:(N-i)]
    b = S[(N-i):(2*N-2*i)]
    if a == b:
        print(len(a)*2)
        exit()

Solution (Python):
def f():
    s = list(input())
    for i in range(len(s)):
        s.pop(-1)
        s.pop(-1)
        c = 0
        for j in range(len(s)//2):
            if s[j] == s[len(s)//2 + j]:
                c += 1
                if c == len(s)//2:
                    return len(s)
            else:
                break
print(f())

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

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

Solution (Python):
s = input()

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

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

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

Solution (Python):
import sys
import copy
import math
import itertools
import numpy as np
S=input()
for i in range(1,len(S)):
    l = len(S[0:len(S)-i]) 
    if l%2==0:
        if S[0:len(S)-i] == S[0:int(l/2)]+S[0:int(l/2)]:
            print(l)
            sys.exit(0)

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

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

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

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

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

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

s = s[:len(s)-1]

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

Solution (Python):
class mystr:
    def __init__(self,string):
        self.value = string

    def isEven(self):
        l = len(self.value)
        if (not l & 1) and self.value[:l//2] == self.value[l//2:]:
            return True
        else:
            return False

    def pop(self):
        l = len(self.value)
        self.value = self.value[:l-1]

s = mystr(input())
l = len(s.value)
for i in reversed(range(l)):
    s.pop()
    if s.isEven():
        print(i)
        break

Solution (Python):
s=input()
temp = 1 if len(s) % 2 != 0 else 2
for i in range(temp, len(s), 2):
  moji = s[:len(s)-i]
  
  if moji[:len(moji)//2] == moji[len(moji)//2:]:
    print(len(moji))
    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 main():
    s = input()
    len_s = len(s)

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


if __name__ == "__main__":
    main()

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

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

while len(s) >= 2:
    half = len(s) // 2
    if s[:half] == s[half:]:
        print(len(s))
        break
    s = s[2:]

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

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

if N%2 == 1:
    M = N-1
else:
    M = N-2

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

Solution (Python):
import sys
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right 
from heapq import heapify, heappop, heappush

sys.setrecursionlimit(10**6)
INF = 10**20

def mint():
    return map(int,input().split())
def lint():
    return map(int,input().split())
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])

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

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

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

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

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

Solution (Python):
S = input().strip()
while len(S) > 0:
  S = S[:-1]
  mid = len(S)//2
  if S[:mid] == S[mid:]:
    print(len(S))
    break

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

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

while True:
    N = N[0:-1]
    if len(N) % 2 == 0:
        if N[0:int(len(N)/2)] == N[int(len(N)/2):]:
            break

print(len(N))

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

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

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

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

Solution (Python):
S = input()

ls = len(S)

while True:
    ls -= 1
    if ls % 2 == 1:
        continue
    leftS = S[0:ls//2]
    rightS = S[ls//2:ls]
    if leftS == rightS:
        print(ls)
        exit()

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    l = len(S)

    while True:
        l -= 2
        first = S[:l // 2]
        second = S[l // 2: l]
        if first == second:
            return print(l)


if __name__ == '__main__':
    main()

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

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

  else:
    S = S[:-2]

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

Solution (Python):
S = input()

odd = len(S) % 2
little = odd + (1-odd)*2
start = len(S)-1-little

ans = 0
for i in range(start,0,-2):
  half = (i+1)//2
  a = S[:half]
  b = S[half:half*2]
  if a == b:
    
    ans = len(a)*2
    break
    
    
print(ans)

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

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



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


print(ans)

Solution (Python):
S = input()
test = ""
tmp = 0
for i in range(1, len(S)):
    j = -1 * i
    test = S[:j]
    tmp = len(test) // 2
    if len(test) % 2 == 0 and test[0:tmp] == test[tmp:]:
        print(len(test))
        exit()

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

for i in range(len(S)-2, 0, -2):
    words: str = S[:i]
    half: int = len(words)//2

    if words[:half] == words[half:]:
        print(half * 2)
        break

Solution (Python):
S = input()

for i in range(1, len(S)):
    gumozi = S[0:len(S)-i]

    if gumozi[0:len(gumozi)//2] == gumozi[(len(gumozi)//2):len(gumozi)]:
        print(len(gumozi))
        exit()
print(0)

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

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

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

Solution (Python):




s = input()
n = len(s)


def isrepeat(s):
    res = False
    n = len(s)
    if s[0:n//2]+s[0:n//2] == s:
        res = True
    return res


for delnum in range(1, n):
    if (n-delnum) % 2 == 0:
        if isrepeat(s[0:n-delnum]):
            ans = n-delnum
            break
print(ans)

Solution (Python):
s = input()

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

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

print(len(s))

Solution (Python):
S=input()
S2=S[:(len(S))//2]
while len(S)>=2:
    S=S[:-2]
    S2=S2[:-1]
    if S==S2+S2:
        print(len(S))
        exit()

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):
import sys

input = sys.stdin.readline

def main():
    ans = 0
    s = input().rstrip('\n')
    ls = len(s)
    for i in range(1,ls):
        if (ls - i)%2 != 0:
            continue
        temps = s[:-i]
        if temps[:(ls-i)//2] == temps[(ls-i)//2:]:
            ans = ls - i 
            break

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    s = input()
    if len(s) % 2 == 0:
        i = len(s) - 2
    else:
        i = len(s) - 1
    while True:
        if s[:int(i/2)] ==  s[int(i/2):i]:
            print(i)
            break
        i -= 2
        


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):

S = list(input())

def judge(A):
    if len(A)%2 == 0:
        if A[:len(A)//2] == A[len(A)//2:]:
            return True
    return False

for i in range(len(S)):
    S.pop()
    if judge(S):
        break
print(len(S))

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

Solution (Python):
S = input()
maxS = ""
for i in range(len(S)//2):
  tmp = S[:i]*2
  j = 2*i
  if tmp == S[:j]:
    maxS = tmp
print(len(maxS))

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

del inp[-1]

ans = 0
S = ""

for s in inp:
    S += s
    N = len(S)
    if N % 2 == 1:
        continue
    if S[:N // 2] == S[N // 2:]:
        ans = max(ans, N)

print(ans)

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

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

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    s = S()
    cut = 1 if len(s)%2==1 else 2
    scut = s[:-cut]
    

    while scut[:len(scut)//2] != scut[len(scut)//2:]:
        cut += 2
        scut = s[:-cut]

    ans = len(scut)
    print(ans)


main()

Solution (Python):
s = input()
l = [s[:-i] for i in range(1,len(s)-1)]

for i in range(len(l)):
    half = len(l[i])//2
    if len(l[i]) % 2 == 0:
        if l[i][:half] == l[i][half:]:
            print(len(l[i]))
            exit()

Solution (Python):
s=input()
S=''.join(list(reversed(s)))
a=1
for i in range(len(S)):
    if (len(S)-a)%2==0:
        if S[a:(len(S)+a)//2]==S[(len(S)+a)//2:len(S)]:
            break
        else:
            a+=1
    else:
        a+=1
print(len(S)-a)

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

tar_index = len(s) - 1
count = 0

while (count < num):
    tar = s[:tar_index]
    tar_num = len(tar)
    
    if (tar_num % 2 == 0):
        half = int(tar_num / 2)

        if (tar[:half] == tar[half:]):
            print(int(2 * len(tar[:half])))
            exit()
        else:
            pass

    else:
        pass

    tar_index -= 1
    count += 1

Solution (Python):

import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


def check(s):
    if (s[len(s) // 2:] == s[:len(s) // 2]):
        print(len(s))
        exit()


S = S()
n = len(S)
if (n % 2 == 0):
    while S:
        S = S[:-2]
        check(S)
else:
    S = S[:-1]
    check(S)
    while S:
        S = S[:-2]
        check(S)

Solution (Python):
def is_gu(s):
    if s[0:len(s)//2] == s[len(s)//2:len(s)]:
        return True
    return False

S = input()
ans = len(S)-2

while True:
    if is_gu(S[0:ans]):
        break
    else:
        ans = ans-2

print(ans)

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

Solution (Python):
s = list(input())
ans = 0
if len(s)%2==0:
    s = s[:-2]
else:
    s.pop(-1)

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

Solution (Python):

S = input()
if len(S) %2 == 0 :
    S = S[:-2]
else :
    S =S[:-1]
while(1) :
    l = int(len(S)/2)

    if S[:l] == S[l:] :
        print(len(S))
        exit()
    S = S[:-2]

Solution (Python):
s = list(input())
s.pop(-1)
while len(s) > 0:
  if len(s) % 2 == 1:
    s.pop(-1)
    continue
  n = len(s)//2
  a = "".join(s[:n])
  b = "".join(s[n:])
  if a == b:
    print(len(s))
    exit()
  s.pop(-1)

Solution (Python):
s = input ()
while len(s) != 0:
  s = s[:-2]
  le = round (len(s)/2)
  if s[:le] == s[le:len(s)]:
    print (len(s))
    break

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

def ss(string):
    if len(string)&2==1:
        retrun(False)
    else:
        for i in range(len(string)//2):
            if S[i]!=S[len(string)//2+i]:
                return(False)
        return(True)

while True:
    if ss(S):
        print(len(S))
        exit()
    else:
        del S[-1]
        del S[-1]

Solution (Python):

S = input()

n = 0
for i in range(200):
    n += 2
    s = S[:len(S) - n]

    if s[: len(s) // 2] == s[len(s) // 2:]:
        print(len(s))
        exit()

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

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

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

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

S.pop(-1)
if (len(S)) % 2 == 1:
  S.pop(-1)
while True:
  count = 0
  for i in range(int(len(S)/2)):
    if S[i] == S[int(len(S)/2) + i]:
      count += 1
      continue
    else:
      break
  if count == len(S)/2:
    print(len(S))
    break
  S.pop(-1)
  S.pop(-1)

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

Solution (Python):
S = input()
s = len(S)
i = 1
while True:
    _S = S[:-i]
    ls = len(_S)
    if _S[:ls//2] == _S[ls//2:]:
        break
    i += 1

print(s - i)

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

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)
        exit()

Solution (Python):
S = input()
N = len(S)
ans = 0
for l in range(N//2+1):
    flag = True
    for i in range(l):
        if S[i] != S[i+l]:
            flag = False
            break
    if flag:
        if l*2 < N:
            ans = max(ans, l)
print(ans*2)

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    s = s_input()

    afeter_index = len(s) - 2
    
    while True:
        middle_index = afeter_index // 2

        tmp1 = s[:middle_index]
        tmp2 = s[middle_index:afeter_index]

        if tmp1 == tmp2:
            print(afeter_index)
            exit()
        
        afeter_index -= 2

if __name__ == '__main__':
    main()

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

Solution (Python):
def gumoji(moji):
    if len(moji)%2==0:
        if moji[:int(len(moji)/2)]==moji[-int(len(moji)/2):]:
            return True
    return False

s = str(input())
s = s[:len(s)-1]

while len(s)>=2:
    if gumoji(s):
        break
    else:
        s = s[:len(s)-1]
    
print(len(s))

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

Solution (Python):
S = input()

len_S = len(S)
for i in range(1, len_S):
    if i % 2 == 0:
        tmp_S = S[:len_S - i]
        n_half = len(tmp_S) // 2
        S_l = tmp_S[:n_half]
        S_r = tmp_S[n_half:]
        if S_l == S_r:
            break
print(len(tmp_S))

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

Solution (Python):
def check(s):
    l=len(s)
    if l%2 :
        return 0
    for i in range(l//2):
        if s[i]!=s[i+l//2]:
            return 0
    return 1        

s = input()
ans = 0
for i in range(1,len(s)):
    if check(s[:len(s)-i]) :
        ans = len(s)-i
        break
print(ans)

Solution (Python):
import re

S = input()
m = re.search(r'\A([a-z]+)\1', S[:len(S) - 1])
print(len(m.group(0)))

Solution (Python):
S = input().strip()
l=len(S)
ans=0
for i in range(0, l-1):
    if i%2==1:
        f=0
        for j in range((i-1)//2):
            if S[j+((i-1)//2)+1]!=S[j]:
                f+=1
        if f<=0:
            ans=i+1
print(ans)

Solution (Python):

def check(s: str) -> bool:
    ls = len(s)
    if ls % 2 != 0:
        return False
    else:
        if "".join(s[:ls//2]) == "".join(s[ls//2:]):
            return True


s = input()
l = len(s)
ans = 0
for i in reversed(range(l-1)):
    if check(s[0:i + 1]):
        ans = i+1
        break

print(ans)

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

def is_even(seq):
  return seq[:len(seq)//2]==seq[len(seq)//2:]

for i in range(len(S)):
  s = S[:len(S)-i]
  if len(s)%2==0 and is_even(s):
    print(len(s))
    exit()

Solution (Python):
def isEvenStr(s):
  if len(s) % 2 == 1:
    return False
  elif s[0:int(len(s)/2)] == s[int(len(s)/2):]:
    return True
  else:
    return False

s = input()
l = len(s)
i = 0

while not isEvenStr(s) or i == 0:
  s = s[:-1]
  i += 1
  if isEvenStr(s):
    print(l - i)

Solution (Python):
S = input()

S = S[:-1]

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

while True:
    half = len(S) // 2 
    if S[:half] == S[half:]:
        print(len(S))
        exit()

    S = S[:-2]