#!/usr/bin/python # -*- coding: utf-8 -*- inp = raw_input() palin_max = 1 #if len(inp) == 1 or (len(inp) == 2 and inp[0]==inp[1]): break for i in range(len(inp)): #回文の起点 for j in range(i+palin_max, len(inp)): #回文の終点 target = inp[i:j+1] if target[:(j-i)/2+1] == target[:(j-i-1)/2:-1]: palin_max = len(target) print target, palin_max if palin_max == len(inp): #全部同じ文字 palin_max -= 1 print palin_max