1s=input()
2a=len(s)
3if (s[0]!=s[a-1]):
4 print(s[0])
5else:
6 for i, j in zip(range(0,int(a/2)+1,1), range(a-1,int(a/2)-1,-1)):
7 if (s[i]!=s[j]) :
8 if (s[i+1]==s[j]):
9 print(s[i])
10 break
11 else:
12 print(s[j])
13 break
14