#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 10;
void in(long long &x) {
  long long y = 1;
  char c = getchar();
  x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') y = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  x *= y;
}
long long read() {
  long long x;
  long long y = 1;
  char c = getchar();
  x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') y = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  x *= y;
  return x;
}
void o(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) o(x / 10);
  putchar(x % 10 + '0');
}
struct linetree {
  long long sum[maxn * 4], lazy[maxn * 4];
  long long a[maxn];
  void PushUp(long long rt) { sum[rt] = sum[rt << 1] + sum[rt << 1 | 1]; }
  void PushDown(long long rt, long long ln, long long rn) {
    if (lazy[rt]) {
      lazy[rt << 1] += lazy[rt];
      lazy[rt << 1 | 1] += lazy[rt];
      sum[rt << 1] += lazy[rt] * ln;
      sum[rt << 1 | 1] += lazy[rt] * rn;
      lazy[rt] = 0;
    }
  }
  void Build(long long l, long long r, long long rt) {
    if (l == r) {
      sum[rt] = a[l];
      return;
    }
    long long m = (l + r) >> 1;
    Build(l, m, rt << 1);
    Build(m + 1, r, rt << 1 | 1);
    PushUp(rt);
  }
  void Update(long long L, long long R, long long C, long long l, long long r,
              long long rt) {
    if (L <= l && r <= R) {
      sum[rt] += C * (r - l + 1);
      lazy[rt] += C;
      return;
    }
    long long m = (l + r) >> 1;
    PushDown(rt, m - l + 1, r - m);
    if (L <= m) Update(L, R, C, l, m, rt << 1);
    if (R > m) Update(L, R, C, m + 1, r, rt << 1 | 1);
    PushUp(rt);
  }
  long long Query(long long L, long long R, long long l, long long r,
                  long long rt) {
    if (L <= l && r <= R) {
      return sum[rt];
    }
    long long m = (l + r) >> 1;
    PushDown(rt, m - l + 1, r - m);
    long long ANS = 0;
    if (L <= m) ANS += Query(L, R, l, m, rt << 1);
    if (R > m) ANS += Query(L, R, m + 1, r, rt << 1 | 1);
    return ANS;
  }
} tre;
long long n, w;
long long lenth;
vector<long long> g;
deque<long long> num, id;
void get() {
  num.clear(), id.clear();
  for (long long i = 1; i <= w; i++) {
    if (i < g.size()) {
      while (!num.empty() && num.back() < g[i]) {
        num.pop_back();
        id.pop_back();
      }
      num.push_back(g[i]);
      id.push_back(i);
    } else if (w - i + 1 > lenth) {
      if (num.front() > 0) tre.Update(i, w - i + 1, num.front(), 1, w, 1);
      i = w - lenth;
      continue;
    }
    if (lenth - id.front() > w - i) {
      num.pop_front();
      id.pop_front();
    }
    if (num.front() < 0 && (i <= w - lenth || w - i + 1 <= w - lenth)) continue;
    tre.Update(i, i, num.front(), 1, w, 1);
  }
}
signed main() {
  in(n);
  in(w);
  for (long long i = 1; i <= n; i++) {
    in(lenth);
    g.clear();
    g.push_back(0);
    for (long long j = 1; j <= lenth; j++) g.push_back(read());
    get();
  }
  for (long long i = 1; i <= w; i++) {
    o(tre.Query(i, i, 1, w, 1));
    putchar(' ');
  }
  putchar('\n');
  return 0;
}
