#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, m, x;
  vector<int> a;
  cin >> n >> v;
  for (int i = 0; i < n; ++i) {
    int met = 0;
    cin >> m;
    for (int j = 0; j < m; ++j) {
      cin >> x;
      if (v > x) met = 1;
    }
    if (met) a.push_back(i);
  }
  cout << a.size() << endl;
  for (int i = 0; i < a.size(); ++i) cout << ++a[i] << ' ';
  return 0;
}
