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.



Sample input:
abaababaab


Sample output:
6

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]
while len(s) != 1:
    if len(s)%2 == 0:
        i = int(len(s)/2)
        if s[:-i] == s[i:]:
            print(len(s))
            break
        else:
            s = s[:-1]
    else:
        s = s[:-1]

Submission status: Accepted

Solution code:
s = input()
for i in range(1,len(s)+1):
    s = s[:-1]
    row = len(s) // 2
    left = s[:row]
    right = s[row:]
    if left == right:
        print(len(s))
        break

Submission status: Accepted

Solution code:


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

Submission status: Accepted

Solution code:
from sys import exit, stdin
S = stdin.readline().rstrip()
len_S = len(S)
for i in range(int(len_S/2)-1, 0, -1):
    if S[:i]+S[:i] == S[:i*2]:
        print(i*2)
        exit()

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]
if len(s) % 2 == 1:
    s = s[:-1]
for i in range(len(s) // 2):
    f = True
    for j in range(len(s) // 2):
        if s[j] != s[len(s) // 2 + j]:
            f = False
    if f:
        break
    s = s[:-2]

print(len(s))

Submission status: Accepted

Solution code:
S = input()

for i in range(1,len(S)):
    if i%2 == 1:continue
    tmp = S[:i//2]
    if S[i//2:i] == tmp:
        ans = i
        
print(ans)

Submission status: Accepted

Solution code:
S=input()[:-2]

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

print(len(S))

Submission status: Accepted

Solution code:
import sys
s = input()
s = s[:len(s)-1]
while 1:
    if len(s) %2 == 1:
        s = s[:len(s)-1]
        continue

    if s[:len(s) // 2] == s[len(s) // 2:]:
        print(len(s))
        sys.exit()
    else:
        s = s[:len(s)-1]

Submission status: Accepted

Solution code:
l=input()
n=len(l)

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

Submission status: Accepted

Solution code:
s = input()
s_list = []

for i in s:
    s_list.append(i)
del s_list[-1]

while True:
    s_half = int(len(s_list)/2)
    s1 = s_list[:s_half]
    s2 = s_list[s_half:]
    if s1 == s2:
        print(s_half*2)
        break
    else:
        del s_list[-1]

Submission status: Accepted

Solution code:
S = input()
if len(S)%2 == 1:
    S = S[:-1]
else:
    S = S[:-2]
divPoint = len(S)//2
while S[:divPoint] != S[divPoint:]:
    S = S[:-2]
    divPoint = len(S)//2
print(len(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
n = len(S)

while True:
    m = len(S)
    S = S[:m - 2]
    if not S:
        print(1)
        exit()
    m = len(S)
    if S[:int(m / 2)] + S[:int(m / 2)] == S:
        print(len(S))
        exit()

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc066/tasks/abc066_b
import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    s = input()
    for i in range(1, len(s) - 1):
        new_s = s[:len(s) - i]
        if len(new_s) % 2 != 0:
            continue
        front = new_s[:len(new_s) // 2]
        back = new_s[len(new_s) // 2:]
        if front == back:
            print(len(new_s))
            exit()


if __name__ == '__main__':
    main()

Submission status: Accepted

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

s=input()
for z in range(2,len(s)+1,2):
  if isEvenString(s[0:len(s)-z]):
    ans=len(s)-z
    break

print(ans)

Submission status: Accepted

Solution code:
s=list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
for x in range(len(s) - 1, 0, -1):
    t = s[:x]
    pivot = len(t) // 2
    if len(t) % 2 == 0 and t[:pivot] == t[pivot:]:
        print(len(t))
        exit()

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

def solve():
    S = input()
    for i in range(1, len(S)):
        s = S[:-i]
        if len(s)%2 != 0: continue # 長さが偶数じゃなければ偶文字列になりえない
        
        pivot = len(s)//2
        upper = s[0:pivot]
        lower = s[pivot:]

        if upper == lower:
            print(len(s))
            return

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())[:-2]
n = len(S)
while S[:n//2] != S[n//2:]:
    S = S[:-2]
    n -= 2
print(n)

Submission status: Accepted

Solution code:
from collections import Counter
s=input()
for i in range(len(s)-1, -1, -1):
	if i % 2 == 1:
		continue
	if s[:i//2] == s[i//2:i]:
		print(i)
		break

Submission status: Accepted

Solution code:
S = input()

S_len = len(S)
if S_len % 2 == 0:
    base = 2
else:
    base = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 入力
S=input()

while True:
  # 末尾を削除
  S=S[:-2]

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

Submission status: Accepted

Solution code:
import re
s=input()[:-1]
ans=re.match(r'(.+)\1',s).group()
print(len(ans))
#copy

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input()[:-1])
for i in range(len(s)):
    if len(s)%2==0:
        if s[0:len(s)//2]*2==s :
            break
        else: s.pop()
    else :
        s.pop()
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
x=len(s)

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

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
S = input()
n = len(S)
ret = 1
for x in range(2, n, 2):
    n = x // 2
    if S[0:n] == S[n:x]:
        ret = x
print(ret)

Submission status: Accepted

Solution code:
s = list(input())
while s:
  mid = len(s)//2
  s.pop()
  if s[:mid] == s[mid:]:
    break
print(len(s))

Submission status: Accepted

Solution code:
s=str(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()
l = (len(x)-1)//2

for i in range(l,0,-1):
  if x[:i] == x[i:i+i]:
    print(i+i)
    break

Submission status: Accepted

Solution code:
S = list(input())
l = len(S)
i = l - 2
while 2 <= i:
    flag = True
    k = i//2
    for j in range(0,k):
        if S[j] != S[j+k]:
            flag = False
            break
    if flag:
        print(i)
        exit()
    i -= 2

Submission status: Accepted

Solution code:
S = list(str(input()))

ans = 0
num = 0
while num < len(S):
  num += 1
  s = S[:len(S)-num]
  if len(s) % 2 == 0:
    if s[:int(len(s)/2)] == s[int(len(s)/2):]:
      ans = len(s)
      break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC066B
S = list(input())
for i in range(len(S)):
    S.pop(-1)
    if len(S)%2 == 0:
        if S[:len(S)//2] == S[len(S)//2:]:
            print(len(S))
            break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
while len(s) != 0:
    s.pop(-1)
    if len(s)%2==0 and s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        break

Submission status: Accepted

Solution code:
s=input()
s=s[0:-2]
while s!=s[0:int(len(s)/2)]*2:
    s=s[0:-2]
print(len(s))

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = list(input())

for i in range(1,len(s)):
    len_s = len(s) - 2 * i
    for j in range(1,len(s)):
        left = s[0:j]
        right = s[j:len_s]
        if left == right:
            ans = len(left + right)
            print(ans)
            exit()
        elif len(left) > len(right):
            break

Submission status: Accepted

Solution code:
s = input()
def guu(t):
    if len(t) % 2 == 1:
        return False
    return t[:len(t)//2] == t[len(t)//2:]
for i in range(len(s)-1, 0, -1):
    if guu(s[:i]):
        ans = len(s[:i])
        break
print(ans)

Submission status: Accepted

Solution code:
S = input()

n = len(S) // 2

i = 1
while True:
    if S[:n-i] == S[n-i:2*(n-i)]:
        print(2*(n-i))
        break
    i += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def solve(s):
  n = len(s)
  if s[:n//2] == s[n//2:n]:
    return n
  else:
    return solve(s[:-2])


if __name__ == "__main__":
  s = str(input())
  print(solve(s[:-2]))

Submission status: Accepted

Solution code:
s = input()

def is_odd_string(s):
    if len(s)%2 ==0:
        i = len(s)//2
        if s[:i] == s[i:]:
            return True
    return False

for i in range(1, len(s)):
    if is_odd_string(s[:-i]):
        print(len(s[:-i]))
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC066B - ss
lst = list(input())
for i in range(len(lst) // 2):
    lst = lst[: -2]
    if lst[: len(lst) // 2] == lst[len(lst) // 2 :]:
        break
print(len(lst))

Submission status: Accepted

Solution code:
# ABC066B - ss
lst = list(input())
for i in range(len(lst)):
    lst.pop()
    length = len(lst)
    if length % 2 == 1:
        continue
    elif lst[: length // 2] == lst[length // 2 :]:
        break
print(length)

Submission status: Accepted

Solution code:
import sys
from collections import Counter

s = input()

for i in range(1, len(s)):
    ts = s[:-i]
    if len(ts) % 2 != 0:
        continue
    #print(len(ts), ts, s[:len(ts)//2], s[len(ts)//2:])
    if ts[:len(ts)//2] == ts[len(ts)//2:]:
        print(len(ts))
        sys.exit()

Submission status: Accepted

Solution code:

def read_input():
    s = input()
    return s

def check_even_string(s):
    if len(s) % 2:
        return False

    mid = len(s)//2
    if s[:mid] == s[mid:]:
        return True

    return False


def submit():
    s = read_input()

    for i in range(1, len(s)):
        if check_even_string(s[:-i]):
            print(len(s[:-i]))
            return

if __name__ == '__main__':
    submit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
S.pop(-1)
for i in range(len(S)):
    if len(S) % 2 != 0:
        S.pop(-1)
        continue
    else:
        if S[:len(S)//2] == S[len(S)//2:]:
            print(len(S))
            break
        else:
            S.pop(-1)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
flag = False
if len(s) % 2 == 1:
    s = s[:-1]
else:
    s = s[:-2]
while True:
    if s[: len(s) // 2] * 2 == s:
        print(len(s))
        break
    s = s[:-2]

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

def check(s):
    if len(s)%2==1:
        return False
    else:
        l = len(s)//2
        if s[:l]==s[l:]:
            return True
        else:
            return False


s = str(input())

for i in reversed(range(1,len(s))):
    # print(s[:i])
    if check(s[:i]):
        print(len(s[:i]))
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

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

def solve():
    s = input()
    slen = len(s)
    for i in range(slen-2, 0, -2):
        if is_even(s[0:i]):
            print(i)
            break




solve()

Submission status: Accepted

Solution code:
S = input()
N = len(S)
c = 0
for i in range(N-1):
  tmp = S[:i+1]
  if len(tmp) % 2 == 1:
    continue
  n = len(tmp) // 2
  if tmp[:n] == tmp[n:] and n > c:
    c = n
print(c*2)

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(len(s)):
    if i % 2 == 0 and s[:i//2] == s[i//2:i]:
        ans = i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def check(s):
    n = len(s)
    if n%2 != 0:
        return False
    else:
        s1 = s[:(n//2)]
        s2 = s[(n//2):]
        if s1 == s2:
            return True
        else:
            return False

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

print(ans)

Submission status: Accepted

Solution code:
S = list(input())

while True:
    S = S[:-1]
    i = len(S) // 2
    if S[:i] == S[i:]:
        print(len(S))
        break

Submission status: Accepted

Solution code:
S = input()
while True:
    S = S[:-2]
    n = len(S)
    if S[:n//2] == S[n//2:]:
        break

print(len(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    S = list(_ for _ in input())
    ans = 1

    for i in range(len(S)):
        if(len(S)%2 == 1 or i ==0):
            S.pop(len(S)-1)
            continue
        mid = len(S)//2

        if(S[:mid] == S[mid:]):
            ans = len(S)
            break
        S.pop(len(S)-1)
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

moji  = list(s)
ans = 0
for n in range(len(moji) // 2):
  parts  = "".join(moji[:n+1])
  check = "".join([parts,parts])
  if check == "".join(moji[:(n+1)*2]) and len(check) != len(s):
    #print("".join(moji[:(n+1)*2]))
    ans = (n+1)*2
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

while True:
    S = S[:-2]
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        break
    else: continue

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
s.reverse()
ans=0
for i in range(2,n,2):
    if s[i:(n+i)//2]==s[(n+i)//2:]:
        ans=n-i
        break
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
while(True):
    S = S[:len(S)-1]
    if len(S) % 2 == 0:
        SA = S[:len(S)//2]
        SB = S[len(S)//2:]
        if SA == SB:
            print(len(S))
            break

Submission status: Accepted

Solution code:
S = input()
s = list(S)
s_len = len(S)

for _ in range(s_len):
    s.pop()
    if len(s) % 2 == 0 and s[:len(s) // 2] == s[len(s) // 2:]:
        ans = len(s)
        break
print(ans)

Submission status: Accepted

Solution code:
import sys
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())

s = ns()
n = len(s)
for i in range(n):
    s = s[:-1]
    if len(s) % 2 == 0:
        m = len(s) // 2
        count = 0
        for j in range(m):
            if s[j] == s[j + m]:
                count += 1
        if count == m:
            print(2 * m)
            exit()

Submission status: Accepted

Solution code:
s = list(input())
for i in range(len(s)):
    del s[-1]
    s = "".join(s)
    if s[0:len(s)//2]*2 == s:
        print(len(s))
        break
    s = list(s)

Submission status: Accepted

Solution code:
s = input()
n = len(s)
s = list(s)
s.pop(len(s)-1)
s.pop(len(s)-2)
for i in range(2,n+1,2):
    if s[:(n-i)//2]==s[(n-i)//2:]:
        print(n-i)
        exit()
    s.pop(n-i-1)
    s.pop(n-i-2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

n = n[:-1]

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

print(len(n))

Submission status: Accepted

Solution code:
S=list(input())
l=len(S)
for i in range(1,l//2):#len=2*i
	if all([S[j]==S[j+i] for j in range(i)]):
		ans=2*i
print(ans)

Submission status: Accepted

Solution code:
s = input()
found = 0
for i in range(len(s)):
    if i % 2 == 0 and i >= 2:
        t = s[:i//2]
        t2 = s[i//2:i]
        if t == t2:
            found = i
print(found)

Submission status: Accepted

Solution code:
import sys
s = str(raw_input())
for i in range(len(s)-2, 0, -2):
	if s[:i/2] == s[i/2:i]:
		print i
		sys.exit()

Submission status: Accepted

Solution code:
def f(s):
  l=len(s)
  if l%2==0:
    return s[:l//2]==s[l//2:]
s=input()
L=len(s)
for i in range(1,L):
  a=s[:L-i]
  if f(a):
    ans=len(a)
    break
print(ans)

Submission status: Accepted

Solution code:
A = input()

for i in range(len(A)):
    A = A[:-1]

    if len(A)%2==1:
        continue

    half_len = int(len(A)/2)
    if A[:half_len] == A[half_len:]:
        break

print(len(A))

Submission status: Accepted

Solution code:
S = list(input())
while (True):
    del S[-2:]
    bunkatsu = int(len(S)/2)
    if (S[:bunkatsu] == S[bunkatsu:]):
        print(len(S))
        break

Submission status: Accepted

Solution code:
S=input()
n=len(S)
r=0
for i in range(n//2):
  for j in range(1,n//2):
    if i+j*2>=1+n:continue
    if S[i:i+j]==S[i+j:i+2*j]:r=max(r,j)
print(r*2)

Submission status: Accepted

Solution code:
#66
s = input()
if len(s)%2==1:
    s = s[:len(s)-1]
else:
    s = s[:len(s)-2]
x = int(len(s)/2)

if s[:x]==s[x:]:
    print(2*x)
else:
    while s[:x]!=s[x:]:
        s = s[:len(s)-2]
        x -=1
    print(2*x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(len(s)):
    k = s[:i]
    if k[:len(k)//2]==k[len(k)//2:]:
        ans = len(k)
print(ans)

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    S = list(map(str, input().strip()))

    S = S[:-2]
    while len(S) >= 2:
        n = len(S) // 2
        a = ''.join(S[:n])
        b = ''.join(S[n:])

        if a == b:
            return 2 * n
        else:
            S = S[:-2]


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
hoge=input()

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

s = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
c = 0
for i in range(2, len(s)+2, 2):
    s = s[:-2]
    if (s[:len(s)//2] == s[len(s)//2:]) & (c==0):
        print(len(s))
        c = 1

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A

#B
s = S()
for i in range(len(s))[::-1]:
    if i%2 == 0:
        if s[:i//2] == s[i//2:i]:
            print(i)
            quit()
#C
"""
n = I()
a = LI()
b = [None for i in range(n)]
k = n//2
if n%2:
    for i in range(n):
        if i%2:
            b[k+(i+1)//2] = a[i]
        else:
            b[k-i//2] = a[i]
else:
    for i in range(n):
        if i%2:
            b[k-(i+1)//2] = a[i]
        else:
            b[k+i//2] = a[i]
print(*b)
"""

#D
"""
n = I()
a = LI()
fact = [1 for i in range(n+2)]
for i in range(1,n+2):
    fact[i]*= fact[i-1]*i
    fact[i] %= mod
inv_fact = [1 for i in range(n+2)]
inv_fact[n+1] = pow(fact[n+1],mod-2,mod)
for i in range(1,n+1)[::-1]:
    inv_fact[i] = inv_fact[i+1]*(i+1)
    inv_fact[i] %= mod
count = [None for i in range(n+1)]
for i in range(n+1):
    if count[a[i]] != None:
        l = count[a[i]]
        r = n-i
        break
    count[a[i]] = i
for i in range(1,n+2):
    ans = fact[n+1]*inv_fact[i]*inv_fact[n+1-i]%mod
    if l+r >= i-1:
        ans -= fact[l+r]*inv_fact[i-1]*inv_fact[l+r-i+1]%mod
        ans %= mod
    print(ans)
"""

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

Solution code:
S = str(input())

for i in reversed(range(len(S))):
    S = S[0:i]
    a = S[0 : (len(S) // 2)]
    b = S[(len(S) // 2):]
    if a == b:
        break
print(len(S))

Submission status: Accepted

Solution code:
def ss(S: str)->int:
    n = len(S)
    ret = 0
    for i in range((n-1)//2):
        if S[i+1:].startswith(S[:i+1]):
            ret = 2*(i+1)

    return ret


if __name__ == "__main__":
    S = input()
    ans = ss(S)
    print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
s = input()
t=s
b=0
def sakana(sak, u):
  a=0
  for j in range(len(u)//2):
    if u[j] != u[(len(u)//2)+j]:
      break
    else:
      a=a+1
  if a==len(u)//2:
    return 0
  else:
    return 1

for i in range(len(t)):
  s=s[:-1]
  if len(s)%2==0 and sakana(i, s)==0:
    break
  else:
    b=b+1
print(len(t)-b-1)

Submission status: Accepted

Solution code:
# 066 B
S = input()

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

Submission status: Accepted

Solution code:
def isGuumozi(s):
    if len(s) % 2 == 1:
        return False
    elif s[:len(s) // 2] == s[len(s) // 2:]:
        return True
    else:
        return False


S = input()

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

Submission status: Accepted

Solution code:
w=list(input())
for i in range(len(w)):
  del w[-1]
  del w[-1]
  if w[0:len(w)//2]==w[len(w)//2:len(w)]:
    print(len(w))
    break

Submission status: Accepted

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