#P1185C1. Exam in BerSU (easy version)

Exam in BerSU (easy version)

Description

The only difference between easy and hard versions is constraints.

A session has begun at Beland State University. Many students are taking exams.

Polygraph Poligrafovich is going to examine a group of nn students. Students will take the exam one-by-one in order from 11-th to nn-th. Rules of the exam are following:

  • The ii-th student randomly chooses a ticket.
  • if this ticket is too hard to the student, he doesn't answer and goes home immediately (this process is so fast that it's considered no time elapses). This student fails the exam.
  • if the student finds the ticket easy, he spends exactly tit_i minutes to pass the exam. After it, he immediately gets a mark and goes home.

Students take the exam in the fixed order, one-by-one, without any interruption. At any moment of time, Polygraph Poligrafovich takes the answer from one student.

The duration of the whole exam for all students is MM minutes (maxtiM\max t_i \le M), so students at the end of the list have a greater possibility to run out of time to pass the exam.

For each student ii, you should count the minimum possible number of students who need to fail the exam so the ii-th student has enough time to pass the exam.

For each student ii, find the answer independently. That is, if when finding the answer for the student i1i_1 some student jj should leave, then while finding the answer for i2i_2 (i2>i1i_2>i_1) the student jj student does not have to go home.

The first line of the input contains two integers nn and MM (1n1001 \le n \le 100, 1M1001 \le M \le 100) — the number of students and the total duration of the exam in minutes, respectively.

The second line of the input contains nn integers tit_i (1ti1001 \le t_i \le 100) — time in minutes that ii-th student spends to answer to a ticket.

It's guaranteed that all values of tit_i are not greater than MM.

Print nn numbers: the ii-th number must be equal to the minimum number of students who have to leave the exam in order to ii-th student has enough time to pass the exam.

Input

The first line of the input contains two integers nn and MM (1n1001 \le n \le 100, 1M1001 \le M \le 100) — the number of students and the total duration of the exam in minutes, respectively.

The second line of the input contains nn integers tit_i (1ti1001 \le t_i \le 100) — time in minutes that ii-th student spends to answer to a ticket.

It's guaranteed that all values of tit_i are not greater than MM.

Output

Print nn numbers: the ii-th number must be equal to the minimum number of students who have to leave the exam in order to ii-th student has enough time to pass the exam.

Sample Input 1

7 15
1 2 3 4 5 6 7

Sample Output 1

0 0 0 0 0 2 3

Sample Input 2

5 100
80 40 40 40 60

Sample Output 2

0 1 1 2 3

Note

The explanation for the example 1.

Please note that the sum of the first five exam times does not exceed M=15M=15 (the sum is 1+2+3+4+5=151+2+3+4+5=15). Thus, the first five students can pass the exam even if all the students before them also pass the exam. In other words, the first five numbers in the answer are 00.

In order for the 66-th student to pass the exam, it is necessary that at least 22 students must fail it before (for example, the 33-rd and 44-th, then the 66-th will finish its exam in 1+2+5+6=141+2+5+6=14 minutes, which does not exceed MM).

In order for the 77-th student to pass the exam, it is necessary that at least 33 students must fail it before (for example, the 22-nd, 55-th and 66-th, then the 77-th will finish its exam in 1+3+4+7=151+3+4+7=15 minutes, which does not exceed MM).