#include <bits/stdc++.h>
using namespace std;
int main() {
  long int k, v, i, c(0), j;
  cin >> k >> v;
  vector<int> a;
  for (i = 1; i <= k; i++) {
    int n, f(0);
    cin >> n;
    int arr[n];
    for (j = 0; j < n; j++) {
      cin >> arr[j];
      if (arr[j] < v && f == 0) {
        c++;
        a.push_back(i);
        f = 1;
      }
    }
  }
  sort(a.begin(), a.end());
  cout << c << endl;
  for (i = 0; i < a.size(); i++) {
    cout << a[i] << " ";
  }
  return 0;
}
