from math import gcd N,M = map(int,input().split()) W = list(map(int,input().split())) if M == 0: print(*W) exit() x = 0 for w in W: x = gcd(x,w) for i in range(N): W[i] //= x x = 0 if M >= sum(W): x = M//sum(W) for i in range(N): W[i] *= x print(*W) else: x = sum(W)//M for i in range(N): W[i] //= x print(*W)