#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 500;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int BS = 31337;
struct monotone {
  deque<long long> D;
  queue<long long> Q;
  void pop() {
    if (D.front() == Q.front()) D.pop_front();
    Q.pop();
  }
  long long mx() { return D.front(); }
  void add(long long x) {
    Q.push(x);
    for (; !D.empty() && D.back() < x; D.pop_back())
      ;
    D.push_back(x);
  }
  void clear() {
    for (; !D.empty();) D.pop_back();
    for (; !Q.empty();) Q.pop();
  }
};
monotone M;
int n, w, a[N], m;
long long pos[N];
long long ob[N];
int main() {
  scanf("%d%d", &n, &w);
  for (int i = 0; i < n; i++) {
    scanf("%d", &m);
    for (int i = 0; i < m; i++) scanf("%d", a + i);
    if (2 * m < w) {
      long long cur = 0;
      for (int i = 0; i < m; i++) {
        cur = max(cur, (long long)a[i]);
        ob[i] += cur;
      }
      cur = 0;
      for (int i = m - 1; i >= 0; i--) {
        cur = max(cur, (long long)a[i]);
        ob[w - (m - i)] += cur;
      }
      pos[m] += cur;
      pos[w - m] -= cur;
    } else {
      int j = 0;
      if (m != w) M.add(0);
      for (int i = 0; i < w; i++) {
        if (i < m) M.add(a[i]);
        if (i == m) M.add(0);
        ob[i] += M.mx();
        if (i - w + m + 1 >= 0) M.pop();
      }
      M.clear();
    }
  }
  for (int i = 1; i < w; i++) {
    pos[i] += pos[i - 1];
  }
  for (int i = 0; i < w; i++) {
    printf("%lld ", pos[i] + ob[i]);
  }
  printf("\n");
  return 0;
}
