#include <bits/stdc++.h>
int main() {
  int n, v, i, j, k, min, ans, x, nCount;
  int id[60];
  ans = 0;
  nCount = 0;
  scanf("%d%d", &n, &v);
  for (i = 1; i <= n; i++) {
    scanf("%d", &k);
    min = 1e6 + 1;
    for (j = 1; j <= k; j++) {
      scanf("%d", &x);
      if (min > x) min = x;
    }
    if (v > min) {
      ans++;
      id[nCount++] = i;
    }
  }
  std::sort(id, id + nCount);
  printf("%d\n", ans);
  if (nCount == 0) {
    return 0;
  }
  for (i = 0; i < nCount; i++)
    if (i == 0)
      printf("%d", id[i]);
    else
      printf(" %d", id[i]);
  return 0;
}
