def main(): N, M = map(int, input().split()) W = list(map(int, input().split())) if M == 0: print(" ".join("0" for _ in range(N))) return sum_weight = sum(W) print(*map(lambda weight: round(M * weight / sum_weight), W)) if __name__ == "__main__": main()