import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class streaming_va {
    public static void main(String[] args) {
        new streaming_va().run();
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;

    public String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public void solve() throws IOException {
        int n = nextInt();
        int C = nextInt();
        int[] a = new int[2 * n];

        for (int i = 0; i < n; i++) {
            a[i + n] = a[i] = nextInt();
        }

        long[] sum = new long[2 * n + 1];
        for (int i = 1; i < sum.length; i++) {
            sum[i] = sum[i - 1] + a[i - 1];
        }

        int[][] next = new int[25][2 * n];
        for (int i = 0; i < 2 * n; i++) {
            int l = i - 1;
            int r = 2 * n - 1;
            while (l < r - 1) {
                int m = (l + r) / 2;
                if (sum[m + 1] - sum[i] < C) {
                    l = m;
                } else {
                    r = m;
                }
            }
            next[0][i] = r + 1;
        }

        int[] pow = new int[next.length];
        pow[0] = 1;
        for (int i = 1; i < next.length; i++) {
            for (int j = 0; j < next[i].length; j++) {
                next[i][j] = next[i - 1][j] == 2 * n ? 2 * n : next[i - 1][next[i - 1][j]];
            }
            pow[i] = 2 * pow[i - 1];
        }

        int[] ans = new int[n];
        for (int i = 0; i < ans.length; i++) {
            int pos = i;
            for (int j = next.length - 1; j >= 0; j--) {
                if (next[j][pos] < n + i) {
                    pos = next[j][pos];
                    ans[i] += pow[j];
                }
            }
            if (next[0][pos] < n + i) {
                throw new AssertionError();
            }
        }

        for (int i = 0; i < n; i++) {
            out.print(ans[i] + " ");
        }
    }

    public void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
        }
    }
}
