Buggy python submission (verdict: Time Limit Exceeded):
import bisect

def main():
    N = int(input())
    CSF = tuple(tuple(map(int, input().split())) for _ in [0] * (N - 1))

    time = [[] for _ in [0] * N]
    end = CSF[0][1] + 1
    for i, (c, s, f) in enumerate(CSF):
        end = max(end, s + 1)
        time[i] = [j for j in range(s, end, f)]
        end += c + s

    for i in range(N - 1):
        sec = 0
        for j in range(i, N - 1):
            n = bisect.bisect_left(time[j], sec)
            sec = time[j][n] + CSF[j][0]
        print(sec)
    print(0)

main()


Fixed submission:
def main():
    N = int(input())
    C, S, F = [], [], []
    capnd, sapnd, fapnd = C.append, S.append, F.append
    for c, s, f in (map(int, input().split()) for _ in [0] * (N - 1)):
        capnd(c)
        sapnd(s)
        fapnd(f)

    for i in range(N):
        t = 0
        for j in range(i, N - 1):
            if t < S[j]:
                t = S[j]
            elif not t % F[j]:
                pass
            else:
                t = t + F[j] - t % F[j]
            t += C[j]
        print(t)

main()

Buggy python submission (verdict: Runtime Error):
import bisect

def main():
    N = int(input())
    CSF = tuple(tuple(map(int, input().split())) for _ in [0] * (N - 1))

    start = [[] for _ in [0] * N]
    arrival = 50000
    for i, (c, s, f) in enumerate(CSF):
        start[i] = [j for j in range(s, arrival, f)]

    for i in range(N - 1):
        sec = 0
        for j in range(i, N - 1):
            n = bisect.bisect_left(start[j], sec)
            sec = start[j][n] + CSF[j][0]
        print(sec)
    print(0)

main()


Fixed submission:
def main():
    N = int(input())
    C, S, F = [], [], []
    capnd, sapnd, fapnd = C.append, S.append, F.append
    for c, s, f in (map(int, input().split()) for _ in [0] * (N - 1)):
        capnd(c)
        sapnd(s)
        fapnd(f)

    for i in range(N):
        t = 0
        for j in range(i, N - 1):
            if t < S[j]:
                t = S[j]
            elif not t % F[j]:
                pass
            else:
                t = t + F[j] - t % F[j]
            t += C[j]
        print(t)

main()

Buggy python submission (verdict: Runtime Error):
import bisect

def main():
    N = int(input())
    CSF = tuple(tuple(map(int, input().split())) for _ in [0] * (N - 1))

    start = [[] for _ in [0] * N]
    for i, (c, s, f) in enumerate(CSF):
        arrival = s + c + 1
        start[i] = [j for j in range(s, arrival, f)]

    for i in range(N - 1):
        sec = 0
        for j in range(i, N - 1):
            n = bisect.bisect_left(start[j], sec)
            sec = start[j][n] + CSF[j][0]
        print(sec)
    print(0)

main()


Fixed submission:
def main():
    N = int(input())
    C, S, F = [], [], []
    capnd, sapnd, fapnd = C.append, S.append, F.append
    for c, s, f in (map(int, input().split()) for _ in [0] * (N - 1)):
        capnd(c)
        sapnd(s)
        fapnd(f)

    for i in range(N):
        t = 0
        for j in range(i, N - 1):
            if t < S[j]:
                t = S[j]
            elif not t % F[j]:
                pass
            else:
                t = t + F[j] - t % F[j]
            t += C[j]
        print(t)

main()