#include <bits/stdc++.h>
std::vector<int> v;
int main() {
  int N, V;
  scanf("%d %d", &N, &V);
  for (int i = 1; i <= N; i++) {
    int k, x;
    bool ok = false;
    scanf("%d", &k);
    for (int j = 1; j <= k; j++) {
      scanf("%d", &x);
      ok |= (x < V);
    }
    if (ok) v.push_back(i);
  }
  printf("%d\n", v.size());
  for (int i = 0; i < v.size(); i++) printf("%d\n", v[i]);
  return 0;
}
