#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y, n, i = 0, sum = 0;
  vector<int> v, vec;
  cin >> x >> y;
  while (x--) {
    i++;
    cin >> n;
    int a[n], c = 0;
    for (int j = 0; j < n; j++) {
      cin >> a[j];
      if (a[j] < y) {
        c++;
      }
    }
    if (c) {
      sum++;
      v.push_back(i);
    }
  }
  cout << sum << endl;
  for (int i = 0; i < v.size(); i++) {
    if (!i) {
      cout << v[i];
    } else {
      cout << " " << v[i];
    }
  }
}
