import sys #input = sys.stdin.readline input = sys.stdin.buffer.readline import math def main(): N,M = map(int,input().split()) A = list(map(int,input().split())) if M == 0: ans = [0]*N print(*ans);exit() g = A[0] for i in range(1,N): g = math.gcd(g,A[i]) AG = [a//g for a in A] s = sum(AG) ans = [(M//s)*ag for ag in AG] print(*ans) if __name__ == '__main__': main()