#include <bits/stdc++.h>
using namespace std;
long long k[51], s[10000001], r[10000001], n, v;
int main() {
  long long p = 0, i, j, h = 0;
  cin >> n >> v;
  for (i = 1; i <= n; i++) r[i] = 0;
  for (i = 1; i <= n; i++) {
    cin >> k[i];
    for (j = 1; j <= k[i]; j++) {
      cin >> s[j];
    }
    for (j = 1; j <= k[i]; j++) {
      if (s[j] < v) {
        r[i] = i;
        p++;
        break;
      }
    }
  }
  cout << p << endl;
  for (i = 1; i <= n; i++) {
    if (r[i] != 0 and h == 0) {
      cout << r[i];
      i++;
      h = 1;
    }
    if (r[i] != 0 and h != 0) cout << " " << r[i];
  }
  return 0;
}
