X, D = map(int, input().split())
Array = [0,0,0,0,0]
S = 0
for i in range(5):
Array[i] = X + S
S += D
print(Array)
X, D = map(int, input().split())
Array = [0,0,0,0,0]
S = 0
for i in range(5):
Array[i] = X + S
S += D
print(Array)