#include <bits/stdc++.h>
using namespace std;
int n, v, re[55], rn;
int main() {
  while (scanf("%d%d", &n, &v) != EOF) {
    rn = 0;
    int k, tmp, flag;
    for (int j = 1; j <= n; j++) {
      scanf("%d", &k);
      flag = 0;
      for (int i = 0; i < k; i++) {
        scanf("%d", &tmp);
        if (tmp < v) flag = 1;
      }
      if (flag) re[rn++] = j;
    }
    printf("%d\n", rn);
    for (int i = 0; i < rn; i++) {
      printf("%d ", re[i]);
    }
    if (rn) printf("\n");
  }
  return 0;
}
