#include <bits/stdc++.h>
using namespace std;
int n, m, a[111], v, second[50], ans;
vector<int> p;
int main() {
  cin >> n >> v;
  for (int i = 1; i <= n; i++) {
    cin >> m;
    bool ok = 0;
    for (int j = 1; j <= m; j++) {
      cin >> a[i];
      if (v > a[i]) ok = 1;
    }
    if (ok == 1) {
      ans++;
      p.push_back(i);
    }
  }
  cout << ans << endl;
  for (int i = 0; i < p.size(); i++) {
    cout << p[i] << " ";
  }
  return 0;
}
