#include <bits/stdc++.h>
using namespace std;
vector<int> vv;
int main() {
  int n, v;
  cin >> n >> v;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    int x = INT_MAX;
    for (int j = 1; j <= a; j++) {
      int p;
      cin >> p;
      x = min(x, p);
    }
    if (x < v) {
      vv.push_back(i);
    }
  }
  cout << vv.size() << "\n";
  for (int i = 0; i < vv.size(); i++) {
    cout << vv[i] << " ";
  }
}
