S = input() L = len(S) ss = set() for i in range(2**L): v = '' head = 0 tail = L-1 for j in range(L): if i & 1<