def subsets(S): S.sort() return [list(c) for i in range(len(S)+1) for c in comb(S, i)]
def combine(n, k): return map(list, comb(range(1, n + 1), k))
def comb2(num): for (i1,n1), (i2,n2) in comb(num, 2): yield i1+i2, n1+n2
def subsetsWithDup(S): S.sort() return [list(c) for i in xrange(len(S) + 1) for c in comb(S, i)]
def combine(n, k): return map(list, comb(range(1,n+1), k))