#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s, v, svar = 0;
  vector<int> vec;
  cin >> n >> v;
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    bool t = 0;
    while (k-- > 0) {
      cin >> s;
      if (s < v) t = 1;
    }
    if (t) svar++, vec.push_back(i + 1);
  }
  cout << svar << endl;
  for (int i = 0; i < vec.size(); i++) cout << vec[i] << ' ';
}
