#include <bits/stdc++.h>
using namespace std;
long long ans[1000006], cnt[1000005], b[1000006];
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  long long n, w;
  cin >> n >> w;
  for (long long p = 1; p <= n; p++) {
    long long l, mx = -2147483647;
    cin >> l;
    for (long long j = 1; j <= l; j++) cin >> b[j], mx = max(mx, b[j]);
    long long move = w - l;
    deque<pair<long long, long long> > dq;
    for (long long i = 1; i < l; i++) {
      while (dq.size() && i - dq.front().second > move) dq.pop_front();
      while (dq.size() && dq.back().first < b[i]) dq.pop_back();
      dq.push_back({b[i], i});
      long long tmp = dq.front().first;
      if (move >= i) tmp = max(0LL, tmp);
      ans[i] += tmp;
    }
    dq.clear();
    for (long long i = w, j = l; j >= 2 && i > l - 1; i--, j--) {
      while (dq.size() && dq.front().second - j > move) dq.pop_front();
      while (dq.size() && dq.back().first < b[j]) dq.pop_back();
      dq.push_back({b[j], j});
      long long tmp = dq.front().first;
      if (move >= l - j + 1) tmp = max(0LL, tmp);
      ans[i] += tmp;
    }
    if (w == 2 * l - 1) {
      ans[l] += mx;
    } else if (w == 2 * l) {
      ans[l] += max(0LL, mx);
      ans[l + 1] += max(0LL, mx);
    } else if (w > 2 * l) {
      ans[l] += max(0LL, mx);
      ans[w - l + 1] += max(0LL, mx);
      cnt[l + 1] += max(0LL, mx);
      cnt[w - l + 1] -= max(0LL, mx);
    }
  }
  long long z = 0;
  for (long long i = 1; i <= w; i++) {
    z += cnt[i];
    cout << ans[i] + z << ' ';
  }
  return 0;
}
