#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v1;
  cin >> n >> v1;
  bool arr[n + 1];
  for (int i = 1; i <= n; i++) {
    arr[i] = false;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int items;
    cin >> items;
    vector<int> v;
    for (int i = 0; i < items; i++) {
      int prices;
      cin >> prices;
      v.push_back(prices);
    }
    sort(v.begin(), v.end());
    if (v1 > v[0]) {
      arr[i] = true;
      ans++;
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= n; i++) {
    if (arr[i] == true) {
      cout << i << " ";
    }
  }
  return 0;
}
