def longestPalindrome(s):
if (s=="") or (len(set(list(s)))==1):
return s
m = s[0]
for i in range(len(s)):
# print( range(len(s)))
for j in range(len(s), i,-1):
# print(range(len(s),i,-1))
print(s[i:j])
if s[i:j]==s[i:j][::-1]:
if (j-i)>len(m):
m=s[i:j]
break
return m