#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v;
  cin >> n >> v;
  int ans = 0;
  vector<int> vec;
  for (int i = 1; i <= n; i++) {
    int x;
    int co = 0;
    cin >> x;
    while (x--) {
      int p;
      cin >> p;
      if (p < v) co++;
    }
    if (co != 0) {
      vec.push_back(i);
      ans++;
    }
  }
  cout << ans << "\n";
  for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
}
