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