#include <bits/stdc++.h>
using namespace std;
long long sum[1000005];
int L[1000005], R[1000005], w, h[1000005], sk[1000005];
void update(int x, int W) {
  for (; x <= w; x += x & -x) sum[x] += W;
}
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &h[i]);
  int q = w - n, l = 1, r = 0;
  h[n + 1] = 0;
  for (int i = 0; i <= n; ++i) {
    while (l <= r && h[sk[r]] < h[i]) --r;
    if (l <= r)
      L[i] = sk[r];
    else
      L[i] = -1;
    sk[++r] = i;
  }
  l = 1, r = 0;
  for (int i = n + 1; i >= 1; --i) {
    while (l <= r && h[sk[r]] <= h[i]) --r;
    if (l <= r)
      R[i] = sk[r];
    else
      R[i] = -1;
    sk[++r] = i;
  }
  for (int i = 1; i <= n; ++i) {
    int mi, mx;
    if (L[i] == -1)
      mi = 1;
    else
      mi = L[i] + q + 1;
    if (R[i] == -1)
      mx = w;
    else
      mx = R[i] - 1;
    mi = max(mi, i);
    mx = min(mx, i + q);
    if (mi <= mx) update(mi, h[i]), update(mx + 1, -h[i]);
  }
}
long long query(int x) {
  long long ans = 0;
  for (; x; x -= x & -x) ans += sum[x];
  return ans;
}
int main() {
  int n;
  scanf("%d%d", &n, &w);
  for (int i = 1; i <= n; ++i) solve();
  for (int i = 1; i <= w; ++i) printf("%lld ", query(i));
}
