#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, money;
  cin >> T >> money;
  int n;
  int g;
  vector<int> lista;
  for (int i = 1; i <= T; i++) {
    cin >> n;
    int brk = 0;
    for (int j = 0; j < n; j++) {
      cin >> g;
      if (brk == 0 && money > g) {
        lista.push_back(i);
        brk = 1;
      }
    }
  }
  cout << lista.size() << endl;
  for (int i = 0; i < lista.size(); i++) {
    cout << lista[i] << " ";
  }
  return 0;
}
