#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7, INF = 0x3f3f3f3f;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long qpow(long long a, long long n) {
  long long r = 1 % P;
  for (a %= P; n; a = a * a % P, n >>= 1)
    if (n & 1) r = r * a % P;
  return r;
}
long long inv(long long first) {
  return first <= 1 ? 1 : inv(P % first) * (P - P / first) % P;
}
char buf[1 << 23], *p1 = buf, *p2 = buf, obuf[1 << 23], *O = obuf;
inline int rd() {
  int t;
  scanf("%d", &t);
  return t;
  int first = 0, f = 1;
  char ch =
      (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
           ? EOF
           : *p1++);
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch =
        (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++);
  }
  while (isdigit(ch))
    first = first * 10 + (ch ^ 48),
    ch =
        (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++);
  return first * f;
}
const int N = 1e6 + 50;
int n, w;
int len[N], a[N], Log[N], f[21][N];
inline void init(int *a, int n) {
  for (int i = 1; i <= n; ++i) f[0][i] = a[i];
  for (int j = 1; j <= 20; ++j)
    for (int i = 0; i + (1 << j - 1) - 1 <= n; ++i) {
      f[j][i] = max(f[j - 1][i], f[j - 1][i + (1 << j - 1)]);
    }
}
inline int RMQ(int l, int r) {
  if (l > r) throw;
  int t = Log[r - l + 1];
  return max(f[t][l], f[t][r - (1 << t) + 1]);
}
long long ans[N], d[N];
void add(int l, int r, long long v) {
  if (l > r) return;
  d[l] += v, d[r + 1] -= v;
}
int main() {
  Log[0] = -1;
  for (int i = 1; i <= N - 1; ++i) Log[i] = Log[i >> 1] + 1;
  n = rd(), w = rd();
  for (int i = 1; i <= n; ++i) {
    int k = rd();
    for (int i = 1; i <= k; ++i) a[i] = rd();
    init(a, k);
    for (int i = 1; i <= k; ++i) {
      if (i < w - k + 1)
        ans[i] += max(0, RMQ(1, i));
      else
        ans[i] += RMQ(i - w + k, i);
    }
    int t = max(0, RMQ(1, k));
    add(k + 1, w - k + 1, t);
    for (int i = max(k + 1, w - k + 1 + 1); i <= w; ++i) {
      int R = k, L = w - k + 1;
      ans[i] += max(0, RMQ(i + k - w, k));
    }
  }
  long long ss = 0;
  for (int i = 1; i <= w; ++i) {
    ss += d[i];
    printf("%lld ", ans[i] + ss);
  }
  putchar(10);
}
