#include <bits/stdc++.h>
using namespace std;
int main() {
  long long v, temp;
  int arr[50], i, n, k, j, count;
  for (i = 0; i < 50; i++) arr[i] = 0;
  cin >> n;
  cin >> v;
  count = 0;
  for (i = 0; i < n; i++) {
    cin >> k;
    for (j = 0; j < k; j++) {
      cin >> temp;
      if ((temp < v) && (arr[i] == 0)) {
        arr[i] = 1;
        count++;
      }
    }
  }
  i = 0;
  cout << count << endl;
  while (count != 0) {
    if (arr[i] == 1) {
      cout << i + 1;
      count--;
    }
    if (count != 0) cout << " ";
    i++;
  }
  cout << endl;
  return 0;
}
