#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, k, c = 0, s, j = 0, arr[50];
  bool val = false;
  cin >> n >> v;
  for (int i = 0; i < n; i++) {
    cin >> k;
    for (int j = 0; j < k; j++) {
      cin >> s;
      if (v > s) {
        val = true;
      }
    }
    if (val) {
      c++;
      arr[j] = i + 1;
      j++;
    }
    val = false;
  }
  cout << c << endl;
  for (int i = 0; i < c; i++) cout << arr[i] << " ";
  return 0;
}
