#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, pr, i, j, k, m, a[51], count = 0;
  cin >> n >> p;
  for (i = 1; i <= n; i++) {
    scanf("%d", &m);
    bool pa = false;
    while (m--) {
      scanf("%d", &pr);
      if (pr < p) {
        pa = true;
      }
    }
    if (pa) {
      a[++count] = i;
    }
  }
  cout << count << endl;
  for (i = 1; i <= count; i++) {
    printf("%d ", a[i]);
  }
}
