#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v;
  vector<int> sol;
  scanf("%d%d", &n, &v);
  for (int i = 1; i <= n; i++) {
    int cnt;
    scanf("%d", &cnt);
    int ok = 0;
    for (int j = 1; j <= cnt; j++) {
      int val;
      scanf("%d", &val);
      if (v > val) ok = 1;
    }
    if (ok) sol.push_back(i);
  }
  printf("%d\n", sol.size());
  for (int i = 0; i < sol.size(); i++) printf("%d ", sol[i]);
}
