import math from sys import stdin n, m, *w = map(int, stdin.read().split()) if m == 0: ans = [0 for i in range(n)] L=[str(i) for i in ans] L=' '.join(L) print(L) exit() wgcd = w[0] for i in range(1,n): if w[i] != 0: if wgcd == 0: wgcd = w[i] else: wgcd = math.gcd(wgcd,w[i]) sum = 0 for i in range(n): w[i] = w[i] // wgcd sum += w[i] ans = [0 for i in range(n)] for i in range(n): ans[i] = m // sum * w[i] L=[str(i) for i in ans] L=' '.join(L) print(L)