#include <bits/stdc++.h>
using namespace std;
int n, m, a[1000000];
long long bank;
vector<int> t;
int main() {
  cin >> n >> m;
  for (int i = 0, k; i < n; i++) {
    cin >> k;
    int p = -1;
    bool q = false;
    for (int j = 0; j < k; j++) {
      cin >> a[j];
      if (a[j] < m) p = 1;
    }
    if (p == true) {
      t.push_back(i);
      bank++;
    }
  }
  cout << bank << endl;
  for (int i = 0; i < t.size(); i++) cout << t[i] + 1 << " ";
}
