#include <bits/stdc++.h>
using namespace std;
template <class T, class Compare = less<int> >
struct segment_tree {
 private:
  struct node {
    T val;
    int left_id, right_id;
    node *l, *r;
  };

 public:
  T mod = 0;
  segment_tree() {}
  segment_tree(T m) { mod = m; }
  node *root;
  node *build(int left, int right, vector<T> &a, int x) {
    node *res = new node;
    res->left_id = left;
    res->right_id = right;
    if (left == right) {
      res->l = res->r = nullptr;
      res->val = a[left];
    } else {
      int mid = (left + right) >> 1;
      res->l = build(left, mid, a);
      res->r = build(mid + 1, right, a);
      T ans = Compare()(res->l->val, res->r->val);
      if (mod) ans %= mod;
      res->val = ans;
    }
    return res;
  }
  T query(node *Node, int left, int right) {
    if (right < Node->left_id || left > Node->right_id) return Compare()();
    if (left <= Node->left_id && right >= Node->right_id) return Node->val;
    T res_1 = query(Node->l, left, right);
    T res_2 = query(Node->r, left, right);
    T ans = Compare()(res_1, res_2);
    if (mod) ans %= mod;
    return ans;
  }
  void update(node *Node, int pos, int new_val) {
    if (pos > Node->right_id || pos < Node->left_id) return;
    if (Node->left_id == Node->right_id)
      Node->val = new_val;
    else {
      update(Node->l, pos, new_val);
      update(Node->r, pos, new_val);
      T ans = Compare()(Node->l->val, Node->r->val);
      if (mod) ans %= mod;
      Node->val = ans;
    }
  }
  node *build(int left, int right, vector<T> &a) {
    return root = build(left, right, a, 1);
  }
  void update(int pos, int new_val) { update(root, pos, new_val); }
  T query(int left, int right) { return query(root, left, right); }
  struct max {
    T operator()(const T &a, const T &b) const { return a > b ? a : b; }
    T operator()() { return -1e9; }
  };
  struct min {
    T operator()(const T &a, const T &b) const { return a < b ? a : b; }
    T operator()() { return 1e9; }
  };
  struct gcd {
    T operator()(const T &a, const T &b) const { return __gcd(a, b); }
    T operator()() { return 1; }
  };
  struct sum {
    T operator()(const T &a, const T &b) { return a + b; }
    T operator()() { return 0; }
  };
  struct mul {
    T operator()(const T &a, const T &b) { return a * b; }
    T operator()() { return 1; }
  };
};
long long a[1 << 20], ans[1 << 20];
int main() {
  srand(time(0));
  int n, w;
  ios::sync_with_stdio(0);
  cin >> n >> w;
  for (int i = 1; i <= n; i++) {
    int k;
    cin >> k;
    vector<int> v;
    v.push_back(0);
    for (int i = 1; i <= k; i++) {
      int x;
      cin >> x;
      v.push_back(x);
    }
    segment_tree<int, segment_tree<int>::max> sg;
    sg.build(1, k, v);
    for (int i = 1; i <= k; i++) {
      int x = sg.query(i - min(i - 1, w - k), i);
      if (i > k || i + k <= w) x = max(x, 0);
      a[i] += x;
      a[i + 1] -= x;
    }
    v.push_back(0);
    reverse(v.begin(), v.end());
    segment_tree<int, segment_tree<int>::max> sg1;
    sg1.build(1, k, v);
    for (int i = 1; i <= min(w - k, k); i++) {
      int x = sg1.query(i - min(i - 1, w - k), i);
      if (i > k || i + k <= w) x = max(x, 0);
      a[w - i + 1] += x;
      a[w - i + 2] -= x;
    }
    if (k + k < w) {
      int mx = sg.query(1, k);
      if (mx > 0) {
        a[k + 1] += mx;
        a[w - k + 1] -= mx;
      } else {
        int l1 = 1;
        int r1 = w - k - 1;
        int l2 = k + 1;
        int r2 = w;
        int l = r1 + 1;
        int r = l2 - 1;
        if (r >= l) {
          a[l] += mx;
          a[r + 1] -= mx;
        }
      }
    }
  }
  for (int i = 1; i <= w; i++) {
    a[i] += a[i - 1];
    cout << a[i] << " ";
  }
}
