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

public class streaming_va_tl2 {
    public static void main(String[] args) {
        new streaming_va_tl2().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();
        }

        int[] ans = new int[n];
        for (int i = 0; i < ans.length; i++) {
            int sum = 0;
            int pos = i;
            while (true) {
                sum = 0;
                while (pos < 2 * n && sum < C) {
                    sum += a[pos];
                    pos++;
                }
                if (pos >= n + i) {
                    break;
                }
                ans[i]++;
            }
        }

        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) {
        }
    }
}
