#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> vec;
  int n, v, a, b;
  bool s;
  cin >> n >> v;
  for (int i = 0; i < n; ++i) {
    s = false;
    cin >> a;
    for (int i = 0; i < a; ++i) {
      cin >> b;
      if (b < v) {
        s = true;
      }
    }
    if (s) {
      vec.push_back(i + 1);
    }
  }
  cout << vec.size() << endl;
  for (int i = 0; i < vec.size(); ++i) {
    cout << vec[i] << " ";
  }
  cout << endl;
  return 0;
}
