#include <bits/stdc++.h>
const long long md = 1e9 + 7;
const int Inf = 1e9;
const long long Inf64 = 1e18;
const long long MaxN = 3e5 + 10;
const long long LogN = 25;
const long long MaxM = 5e5 + 10;
const long double eps = 1e-7;
const long long dx[4] = {0, 1, 0, -1};
const long long dy[4] = {1, 0, -1, 0};
const long long ddx[4] = {1, 1, -1, -1};
const long long ddy[4] = {1, -1, 1, -1};
const long double Pi = acos(-1);
using namespace std;
template <typename T>
istream &operator>>(istream &in, pair<T, T> &a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T>
ostream &operator<<(ostream &out, pair<T, T> a) {
  out << a.first << ' ' << a.second;
  return out;
}
template <typename T>
istream &operator>>(istream &in, vector<T> &Mt) {
  for (T &a : Mt) in >> a;
  return in;
}
template <typename T>
ostream &operator<<(ostream &out, vector<T> Mt) {
  for (int i = 0; i < Mt.size(); i++) {
    out << Mt[i];
    if (i != Mt.size()) out << ' ';
  }
  out << '\n';
  return out;
}
inline long long Mod(long long &a, long long m = md) {
  while (a >= m) a -= m;
  return a;
}
inline long long gcd(long long a, long long b) {
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
}
inline long long gcdex(long long a, long long mod = md) {
  long long g = mod, r = a, x = 0, y = 1;
  while (r != 0) {
    long long q = g / r;
    g %= r;
    swap(g, r);
    x -= q * y;
    swap(x, y);
  }
  return x < 0 ? x + mod : x;
}
inline long long binpow(long long a, long long n, long long m = md) {
  long long res = 1;
  while (n) {
    if (n & 1) {
      res *= a;
      res %= m;
    }
    a *= a;
    a %= m;
    n >>= 1;
  }
  return res % md;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed, cout.precision(20);
  {
    long long N, W;
    cin >> N >> W;
    vector<long long> Ans(W);
    vector<long long> Sv(W + 1);
    vector<long long> Mt;
    for (int i = 0; i < N; i++) {
      long long K;
      cin >> K;
      Mt.resize(K);
      cin >> Mt;
      long long Mx = *max_element(Mt.begin(), Mt.end());
      Mx = max(0ll, Mx);
      if (K == W) {
        for (int j = 0; j < W; j++) {
          Ans[j] += Mt[j];
        }
      } else if (K * 2 > W) {
        long long d = W - K;
        deque<pair<long long, long long> > St;
        St.push_back({-1, 0});
        Mt.push_back(0);
        K++;
        for (int j = 0; j < W; j++) {
          while (St.size() && St.front().first < j - d) St.pop_front();
          if (j < K) {
            while (St.size() && St.back().second <= Mt[j]) St.pop_back();
            St.push_back({j, Mt[j]});
          }
          Ans[j] += St.front().second;
        }
      } else {
        Sv[K] += Mx;
        Sv[W - K] -= Mx;
        long long M = 0;
        for (int j = 0; j < K; j++) {
          M = max(M, Mt[j]);
          Ans[j] += M;
        }
        M = 0;
        for (int j = 0; j < K; j++) {
          M = max(M, Mt[K - j - 1]);
          Ans[W - 1 - j] += M;
        }
      }
    }
    for (int i = 1; i < W; i++) Sv[i] += Sv[i - 1], Ans[i] += Sv[i];
    Ans[0] += Sv[0];
    cout << Ans;
  }
END:
  return 0;
}
