#include <bits/stdc++.h>
using namespace std;
const int N = 50, geps = 10;
int n, v, ansnum = 0, ans[N + geps];
void bg(int p) {
  int k, a;
  bool o = false;
  scanf("%d", &k);
  for (int i = (1); i <= (k); ++i) {
    scanf("%d", &a);
    if (a < v) {
      o = true;
    }
  }
  if (o == true) ans[++ansnum] = p;
}
void Solve() {
  scanf("%d%d", &n, &v);
  for (int i = (1); i <= (n); ++i) {
    bg(i);
  }
  printf("%d\n", ansnum);
  for (int i = (1); i <= (ansnum); ++i) printf("%d ", ans[i]);
  printf("\n");
}
int main() {
  Solve();
  return 0;
}
