#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, v, k, s[51], i, j, l = 1, p = 0, q[51], mn = 10000000;
  cin >> n >> v;
  for (i = 1; i <= n; i++) {
    cin >> k;
    for (j = 1; j <= k; j++) {
      cin >> s[j];
      mn = min(mn, s[j]);
    }
    if (mn < v) {
      p++;
      q[l] = i;
      l++;
    }
    mn = 10000000;
  }
  cout << p << endl;
  for (i = 1; i < l; i++) {
    cout << q[i] << " ";
  }
  return 0;
}
