#include <bits/stdc++.h>
using namespace std;
const int OO = int(1e12);
int main() {
  int n;
  long v;
  cin >> n >> v;
  set<int> q;
  for (int(i) = 0; (i) < (n); (i)++) {
    int k;
    cin >> k;
    for (int(j) = 0; (j) < (k); (j)++) {
      long s;
      cin >> s;
      if (v > s) {
        q.insert(i);
      }
    }
  }
  printf("%d\n", int((q).size()));
  for (set<int>::iterator it = q.begin(); it != q.end(); ++it) {
    cout << (it == q.begin() ? "" : " ") << *it + 1;
  }
  cout << "\n";
  return 0;
}
