#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int INF = 0x3f3f3f3f;
int n, w, a[N];
long long an[N];
struct max_tree {
  int l, r, mxx;
} tr[N << 2];
void build(int l, int r, int rt) {
  tr[rt].l = l, tr[rt].r = r, tr[rt].mxx = -INF;
  if (l == r) {
    tr[rt].mxx = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
  tr[rt].mxx = max(tr[rt << 1].mxx, tr[rt << 1 | 1].mxx);
}
int query(int ql, int qr, int rt) {
  int l = tr[rt].l, r = tr[rt].r;
  if (ql <= l and r <= qr) {
    return tr[rt].mxx;
  }
  int mid = (l + r) >> 1, ans = -INF;
  if (ql <= mid) ans = max(ans, query(ql, qr, rt << 1));
  if (qr > mid) ans = max(ans, query(ql, qr, rt << 1 | 1));
  return ans;
}
struct ans_tree {
  int l, r;
  long long sum;
} ans[N << 2];
void init(int l, int r, int rt) {
  ans[rt].l = l, ans[rt].r = r;
  ans[rt].sum = 0;
  if (l == r) return;
  int mid = (l + r) >> 1;
  init(l, mid, rt << 1);
  init(mid + 1, r, rt << 1 | 1);
}
void update(int ql, int qr, long long v, int rt) {
  int l = ans[rt].l, r = ans[rt].r;
  if (ql <= l and r <= qr) {
    ans[rt].sum += v;
    return;
  }
  int mid = (l + r) >> 1;
  if (ql <= mid) update(ql, qr, v, rt << 1);
  if (qr > mid) update(ql, qr, v, rt << 1 | 1);
}
void push_down(int rt, long long sum) {
  long long now = sum + ans[rt].sum;
  int l = ans[rt].l, r = ans[rt].r;
  if (l == r) {
    an[l] = now;
    return;
  }
  push_down(rt << 1, now);
  push_down(rt << 1 | 1, now);
}
void main_solve() {
  cin >> n >> w;
  init(1, w, 1);
  for (int i = 1; i <= n; ++i) {
    int m;
    cin >> m;
    for (int j = 1; j <= m; ++j) cin >> a[j];
    build(1, m, 1);
    int dx = (w - m);
    for (int l = 1, r; l <= w; l = r + 1) {
      r = l;
      int s = max(1, l - dx), e = min(l, m);
      int v = query(s, e, 1);
      if (l - dx <= 0 or m < r) v = max(0, v);
      if (l - dx <= 1 and m <= r) r = max(r, dx);
      update(l, r, 1LL * v, 1);
    }
  }
  push_down(1, 0LL);
  for (int i = 1; i <= w; ++i) cout << an[i] << ' ';
  cout << '\n';
  return;
}
signed main() {
  iostream::sync_with_stdio(false);
  int T = 1;
  while (T--) main_solve();
  return 0;
}
