def max_contig_sum(L):
    """ L, a list of integers, at least one positive
    Returns the maximum sum of a contiguous subsequence in L """

############# This is getting the biggest powerset of L
    
#    def powerset(s):
#        x = len(s)
#        masks = [1 << i for i in range(x)]
#        for i in range(1 << x):
#            yield [ss for mask, ss in zip(masks, s) if i & mask]
#            
#    max_value = 0
#    for i in list(powerset(L)):
#        if sum(i) > max_value:
#            max_value = sum(i)
#    return max_value
    
############ This is getting the maximum contiguous subsequence
    
    max_value = 0
    value = 0
    for i in range(len(L)):
        value = value + L[i]
        if value < 0:
            value = 0
        if max_value < value:
            max_value = value
    return max_value