def main():
    vec = [1, 2, 5, -4, 5, 6, -7, 1, -1, -7, 1, -10, 1, -3, 4]
    print(vec)
    i = 0
    n = len(vec)
    p = 1
    smax = 0
    while i < n:
        while i < n and vec[i] <= 0:
            i += 1
        p = i
        s = 0
        while i < n and vec[i] >= 0:
            s += vec[i]
            i += 1
        if s > smax:
            smax = s
            pmax = p
            lmax = i - p
    print("Position: ",pmax)
    print("Summa:", smax)
    print("Length: ",lmax)
main()
