#include <bits/stdc++.h>
using namespace std;
void checkpoint1() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  checkpoint1();
  long long n, k;
  cin >> n >> k;
  vector<long long> v;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    bool op = false;
    for (long long j = 0; j < x; j++) {
      long long y;
      cin >> y;
      if (y < k) op = 1;
    }
    if (op) v.push_back(i + 1);
  }
  cout << v.size() << "\n";
  for (auto i : v) cout << i << " ";
  return 0;
}
