#include <bits/stdc++.h>
int main() {
  int TotalSellers, Amount, Answer[100] = {0}, i, Current, Count = 0, j = 0,
                            Items, flag, Number = 1;
  memset(Answer, 0, sizeof(int) * 100);
  scanf("%d%d", &TotalSellers, &Amount);
  while (TotalSellers--) {
    scanf("%d", &Items);
    flag = 0;
    for (i = 0; i < Items; i++) {
      scanf("%d", &Current);
      if (Current < Amount) flag = 1;
    }
    if (flag) {
      Count++;
      Answer[j++] = Number;
    }
    Number++;
  }
  printf("%d\n", Count);
  for (i = 0; i < j; i++) printf("%d ", Answer[i]);
  if (Count) printf("\n");
  return 0;
}
