#include <bits/stdc++.h>
const int INF = ~0U >> 1;
using std::vector;
vector<int> vc;
int main() {
  int n, v;
  scanf("%d%d", &n, &v);
  for (int i = 1; i <= n; ++i) {
    int k;
    scanf("%d", &k);
    int mn = INF;
    while (k--) {
      int t;
      scanf("%d", &t);
      mn = std::min(mn, t);
    }
    if (mn < v) vc.push_back(i);
  }
  printf("%d\n", (int)vc.size());
  for (int i = 0; i < vc.size(); ++i)
    printf("%d%c", vc[i], i == vc.size() - 1 ? '\n' : ' ');
  return 0;
}
