Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import copy

n = int(input())
c = np.zeros((n-1), dtype=np.int)
s = np.zeros((n-1), dtype=np.int)
f = np.zeros((n-1), dtype=np.int)
for i in range(n-1):
    c[i], s[i], f[i] = map(int, input().split(" "))

t = np.zeros(n, dtype=np.int)
for i in range(n-1):
    w = np.zeros((n-1), dtype=np.int)
    w = copy.deepcopy(s)
    t[i] = s[i] + c[i]
    for j in range((i+1), (n-1), 1):
        k = 0
        while(True):
            if(w[j] >= t[i]):
                t[i] = w[j]
                break
            while(w[j] < t[i]):
                w[j] += f[j]
        t[i] += c[j]

for i in range(n):
    print(t[i])

Fixed submission:
import numpy as np
import copy

n = int(input())
c = np.zeros((n-1), dtype=np.int)
s = np.zeros((n-1), dtype=np.int)
f = np.zeros((n-1), dtype=np.int)
for i in range(n-1):
    c[i], s[i], f[i] = map(int, input().split(" "))

t = np.zeros(n, dtype=np.int)
for i in range(n-1):
    t[i] = s[i] + c[i]
    for j in range((i+1), (n-1), 1):
        if(s[j] >= t[i]):
            t[i] = s[j]
        elif(t[i] % f[j] != 0):
            t[i] += f[j] - (t[i] % f[j])
        t[i] += c[j]

for i in range(n):
    print(t[i])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import copy

n = int(input())
c = np.zeros((n-1), dtype=np.int)
s = np.zeros((n-1), dtype=np.int)
f = np.zeros((n-1), dtype=np.int)
for i in range(n-1):
    c[i], s[i], f[i] = map(int, input().split(" "))

t = np.zeros(n, dtype=np.int)
for i in range(n-1):
    w = np.zeros((n-1), dtype=np.int)
    w = copy.deepcopy(s)
    t[i] = s[i] + c[i]
    for j in range((i+1), (n-1), 1):
        k = 0
        while(True):
            if(w[j] >= t[i]):
                t[i] = w[j]
                break
            for l in range(j, (n-1), 1):
                if(t[i] > w[l]):
                    w[l] += f[l]
        t[i] += c[j]

for i in range(n):
    print(t[i])

Fixed submission:
import numpy as np
import copy

n = int(input())
c = np.zeros((n-1), dtype=np.int)
s = np.zeros((n-1), dtype=np.int)
f = np.zeros((n-1), dtype=np.int)
for i in range(n-1):
    c[i], s[i], f[i] = map(int, input().split(" "))

t = np.zeros(n, dtype=np.int)
for i in range(n-1):
    t[i] = s[i] + c[i]
    for j in range((i+1), (n-1), 1):
        if(s[j] >= t[i]):
            t[i] = s[j]
        elif(t[i] % f[j] != 0):
            t[i] += f[j] - (t[i] % f[j])
        t[i] += c[j]

for i in range(n):
    print(t[i])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import copy

n = int(input())
c = np.zeros((n-1), dtype=np.int)
s = np.zeros((n-1), dtype=np.int)
f = np.zeros((n-1), dtype=np.int)
for i in range(n-1):
    c[i], s[i], f[i] = map(int, input().split(" "))

t = np.zeros(n, dtype=np.int)
for i in range(n-1):
    w = np.zeros((n-1), dtype=np.int)
    w = copy.deepcopy(s)
    t[i] = s[i] + c[i]
    for j in range((i+1), (n-1), 1):
        k = 0
        while(True):
            if(w[j] >= t[i]):
                t[i] = w[j]
                break
            for l in range(n-1):
                if(t[i] > w[l]):
                    w[l] += f[l]
        t[i] += c[j]

for i in range(n):
    print(t[i])

Fixed submission:
import numpy as np
import copy

n = int(input())
c = np.zeros((n-1), dtype=np.int)
s = np.zeros((n-1), dtype=np.int)
f = np.zeros((n-1), dtype=np.int)
for i in range(n-1):
    c[i], s[i], f[i] = map(int, input().split(" "))

t = np.zeros(n, dtype=np.int)
for i in range(n-1):
    t[i] = s[i] + c[i]
    for j in range((i+1), (n-1), 1):
        if(s[j] >= t[i]):
            t[i] = s[j]
        elif(t[i] % f[j] != 0):
            t[i] += f[j] - (t[i] % f[j])
        t[i] += c[j]

for i in range(n):
    print(t[i])