#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, s, x, y, c = 0;
  cin >> n >> v;
  vector<int> v1, v2;
  vector<pair<int, vector<int> > > vec;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int j = 0; j < x; j++) {
      cin >> y;
      v1.push_back(y);
    }
    vec.push_back((make_pair(x, v1)));
    v1.clear();
  }
  for (int j = 0; j < vec.size(); j++) {
    for (int i = 0; i < vec[j].first; i++) {
      if (v > vec[j].second[i]) {
        c++;
        v2.push_back(j + 1);
        break;
      }
    }
  }
  cout << c << endl;
  sort(v2.begin(), v2.end());
  for (int i = 0; i < v2.size(); i++) {
    if (c == 0)
      cout << endl;
    else {
      if (i != v2.size() - 1)
        cout << v2[i] << " ";
      else
        cout << v2[i];
    }
  }
  return 0;
}
