#include <bits/stdc++.h>
using namespace std;
vector<long long> vec;
int main() {
  long long n, m, v, k;
  cin >> n >> v;
  for (long long i = 0; i < n; i++) {
    int mark = 0;
    cin >> m;
    for (long long j = 0; j < m; j++) {
      cin >> k;
      if (k < v && mark == 0) {
        vec.push_back(i + 1);
        mark = 1;
      }
    }
  }
  cout << vec.size() << endl;
  for (long long i = 0; i < vec.size(); i++) cout << vec[i] << " ";
  return 0;
}
