#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5, inf = 1e9 + 7;
int a[N], L[N], R[N], fa[N];
long long sum[N];
void build(int n) {
  static int top, stk[N];
  for (int i = top = 0; i <= n; i++) {
    stk[i] = L[i] = R[i] = fa[i] = 0;
  }
  stk[top++] = 1;
  for (int i = 2; i <= n; i++) {
    while (top && a[stk[top - 1]] < a[i]) --top;
    if (top > 0) {
      int x = i, y = stk[top - 1];
      L[x] = R[y], fa[L[x]] = x, fa[x] = y, R[y] = x;
      stk[top++] = x;
    } else {
      fa[stk[0]] = i, L[i] = stk[0];
      stk[top++] = i;
    }
  }
}
int lb[N], rb[N];
void dfs(int i, int l, int r) {
  if (l > r) return;
  int tl = max(l, lb[i]), tr = min(r, rb[i]);
  if (tl <= tr) {
    sum[tl] += a[i], sum[tr + 1] -= a[i];
  }
  dfs(L[i], l, tl - 1), dfs(R[i], tr + 1, r);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, w;
  cin >> n >> w, w += 2;
  for (int _ = 1; _ <= n; _++) {
    int len;
    cin >> len, len += 2;
    for (int i = 2; i < len; i++) {
      cin >> a[i];
      lb[i] = i, rb[i] = max(i, w - len + i);
    }
    lb[1] = 1, rb[1] = max(1, w - len + 1);
    lb[len] = len, rb[len] = max(len, w), a[len] = 0;
    build(len);
    for (int i = 1; i <= len; i++) {
      if (fa[i] == 0) dfs(i, 1, w);
    }
  }
  for (int i = 2; i < w; i++) {
    cout << (sum[i] += sum[i - 1]) << " \n"[i + 1 == w];
  }
}
