from itertools import combinations S = raw_input() N = len(S) mem = {} def rec(b): if b in mem: return mem[b] L = [i for i in xrange(N) if (1<