#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, c, x;
  cin >> n >> v;
  vector<long> sellers;
  for (int i = 1; i <= n; i++) {
    bool ani = false;
    cin >> c;
    for (int j = 0; j < c; j++) {
      cin >> x;
      if (!ani && x < v) {
        sellers.push_back(i);
        ani = true;
      }
    }
  }
  sort(sellers.begin(), sellers.end());
  cout << sellers.size() << endl;
  for (auto& seller : sellers) cout << seller << " ";
  return 0;
}
