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 n students. Students will take the exam one-by-one in order from 1-th to n-th. Rules of the exam are following:

  * The i-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 t_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 M minutes (max t_i ≤ 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 i, you should count the minimum possible number of students who need to fail the exam so the i-th student has enough time to pass the exam.

For each student i, find the answer independently. That is, if when finding the answer for the student i_1 some student j should leave, then while finding the answer for i_2 (i_2>i_1) the student j student does not have to go home.

Input

The first line of the input contains two integers n and M (1 ≤ n ≤ 100, 1 ≤ M ≤ 100) — the number of students and the total duration of the exam in minutes, respectively.

The second line of the input contains n integers t_i (1 ≤ t_i ≤ 100) — time in minutes that i-th student spends to answer to a ticket.

It's guaranteed that all values of t_i are not greater than M.

Output

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

Examples

Input


7 15
1 2 3 4 5 6 7


Output


0 0 0 0 0 2 3 

Input


5 100
80 40 40 40 60


Output


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=15 (the sum is 1+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 0.

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

In order for the 7-th student to pass the exam, it is necessary that at least 3 students must fail it before (for example, the 2-nd, 5-th and 6-th, then the 7-th will finish its exam in 1+3+4+7=15 minutes, which does not exceed M).
//Author: Patel Rag
//Java version "1.8.0_211"
import java.util.*;
import java.io.*;

public class Main
{
  static class FastReader
  {
    BufferedReader br;
    StringTokenizer st;

    public FastReader(){ br = new BufferedReader(new InputStreamReader(System.in)); }

    String next()
    {
      while (st == null || !st.hasMoreElements())
      {
        try
        {
          st = new StringTokenizer(br.readLine());
        }
        catch (IOException  e)
        {
          e.printStackTrace();
        }
      }
      return st.nextToken();
    }

    int nextInt() { return Integer.parseInt(next()); }

    long nextLong(){ return Long.parseLong(next()); }

    double nextDouble(){ return Double.parseDouble(next()); }

    float nextFloat() { return Float.parseFloat(next()); }

    boolean nextBoolean() { return Boolean.parseBoolean(next()); }

    String nextLine()
    {
      String str = "";
      try
      {
        str = br.readLine();
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
      return str;
    }
  }
  static long modExp(long x, long n, long mod)    //binary Modular exponentiation
  {
    long result = 1;
    while(n > 0)
    {
        if(n % 2 == 1)
            result = (result%mod * x%mod)%mod;
        x = (x%mod * x%mod)%mod;
        n=n/2;
    }
    return result;
  }
  static long gcd(long a, long b)
  {
    if(a==0) return b;
    return gcd(b%a,a);
  }
  public static void main(String[] args)
  throws IOException
  {
    FastReader fr = new FastReader();
    int n = fr.nextInt();
    int M = fr.nextInt();
    int[] t = new int[n];
    for(int i = 0; i < n; i++) t[i] = fr.nextInt();
    TreeSet<Integer> set = new TreeSet<>();
    int[] cnt = new int[101];
    Arrays.fill(cnt,0);
    System.out.print(0 + " ");
    set.add(t[0]);
    cnt[t[0]]++;
    int spe = t[0];
    for(int i = 1; i < n; i++)
    {
      TreeSet<Integer> temp = new TreeSet<>();
      temp.addAll(set);
      int[] c = new int[101];
      c = Arrays.copyOf(cnt,101);
      int left = M - spe;
      int ans = 0;
      while(left < t[i])
      {
          int val = temp.last();
          c[val]--;
          if(c[val] == 0) temp.pollLast();
          left = left + val;
          ans++;
      }
      spe = spe + t[i];
      cnt[t[i]]++;
      set.add(t[i]);
      System.out.print(ans + " ");
    }


  }
}
class Pair<U, V>  // Pair class
{
    public final U first;       // first field of a Pair
    public final V second;      // second field of a Pair

    private Pair(U first, V second)
    {
      this.first = first;
      this.second = second;
    }

    @Override
    public boolean equals(Object o)
    {
      if (this == o) return true;

      if (o == null || getClass() != o.getClass()) return false;

      Pair<?, ?> pair = (Pair<?, ?>) o;

      if (!first.equals(pair.first)) return false;
      return second.equals(pair.second);
    }

    @Override
    public int hashCode()
    {
      return 31 * first.hashCode() + second.hashCode();
    }

    public static <U, V> Pair <U, V> of(U a, V b)
    {
      return new Pair<>(a, b);
    }
}
class myComp implements Comparator<Pair>
{
  public int compare(Pair a,Pair b)
  {
    if(a.first != b.first) return ((int)a.first - (int)b.first);
    if(a.second != b.second) return ((int)a.second - (int)b.second);
    return 0;
  }
}
class BIT       //Binary Indexed Tree aka Fenwick Tree
{
  public long[] m_array;

  public BIT(long[] dat)
  {
    m_array = new long[dat.length + 1];
    Arrays.fill(m_array,0);
    for(int i = 0; i < dat.length; i++)
    {
      m_array[i + 1] = dat[i];
    }
    for(int i = 1; i < m_array.length; i++)
    {
      int j = i + (i & -i);
      if(j < m_array.length)
      {
        m_array[j] = m_array[j] + m_array[i];
      }
    }
  }

  public final long prefix_query(int i)
  {
    long result = 0;
    for(++i; i > 0; i = i - (i & -i))
    {
      result = result + m_array[i];
    }
    return result;
  }

  public final long range_query(int fro, int to)
  {
    if(fro == 0)
    {
      return prefix_query(to);
    }
    else
    {
      return (prefix_query(to) - prefix_query(fro - 1));
    }
  }

  public void update(int i, long add)
  {
    for(++i; i < m_array.length; i = i + (i & -i))
    {
      m_array[i] = m_array[i] + add;
    }
  }
}
