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