#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, k, s, p = 0, m = 0;
  cin >> n >> v;
  int asd[2500];
  for (int i = 0; i < n; i++) {
    cin >> k;
    for (int j = 0; j < k; j++) {
      cin >> s;
      if (v > s) p = 1;
    }
    if (p == 1) {
      asd[m] = i + 1;
      m++;
    }
    p = 0;
  }
  cout << m << endl;
  for (int i = 0; i < m; i++) cout << asd[i] << " ";
  return 0;
}
