#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, i, j, k, arr[100], brr[100], count = 0;
  cin >> n >> v;
  for (i = 1; i <= n; i++) {
    cin >> k;
    for (j = 0; j < k; j++) cin >> arr[j];
    for (j = 0; j < k; j++) {
      if (arr[j] < v) {
        count++;
        brr[i] = i;
        break;
      } else
        brr[i] = 0;
    }
  }
  cout << count << endl;
  if (count >= 1) {
    for (i = 1; i <= n; i++) {
      if (brr[i] == 0)
        continue;
      else
        cout << brr[i] << " ";
    }
  }
  return 0;
}
