#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long INF = 2 * 1000 * 1000 + 200;
const long long MAXN = 2 * 100 * 100 + 20;
const long long MLOG = 18;
const long long NMAX = 1 * 1000;
signed main() {
  ios_base::sync_with_stdio(false);
  ;
  long long n, v;
  cin >> n >> v;
  vector<long long> seller;
  for (long long i = 0; i < n; i++) {
    long long a, p;
    cin >> p;
    bool q = false;
    for (long long i = 0; i < p; i++) cin >> a, q |= (a < v);
    if (q) seller.push_back(i + 1);
  }
  cout << (long long)(seller.size()) << endl;
  for (long long i = 0; i < (long long)(seller.size()); i++)
    cout << seller[i] << ' ';
}
