#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, q = 0, arr[10000], num, pric;
  bool check;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    check = false;
    cin >> num;
    for (int x = 0; x < num; x++) {
      cin >> pric;
      if (pric < k) {
        check = true;
      }
    }
    if (check) {
      arr[q++] = i;
    }
  }
  cout << q << endl;
  for (int i = 0; i < q; i++) {
    cout << arr[i] << " ";
  }
  return 0;
}
