#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, t, t2;
  bool flag;
  cin >> n >> v;
  vector<int> ret;
  for (int i = 0; i < n; i++) {
    cin >> t;
    for (int j = 0, flag = false; j < t; j++) {
      cin >> t2;
      if (t2 < v && !flag) {
        ret.push_back(i);
        flag = true;
      }
    }
  }
  cout << ret.size() << endl;
  for (int i = 0; i < ret.size(); i++) cout << ret[i] + 1 << " ";
  return 0;
}
