#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 k, s;
    bool found = 0;
    cin >> k;
    for (int j = 0; j < k; j++) {
      cin >> s;
      if (s < v && found == 0) {
        vec.push_back(i);
        found = 1;
      }
    }
  }
  cout << vec.size() << endl;
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i] + 1 << " ";
  }
}
