#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> ans;
  for (int j = 0; j < n; j++) {
    int size;
    cin >> size;
    bool isAlready = false;
    for (int i = 0; i < size; i++) {
      int no;
      cin >> no;
      if (k > no) {
        isAlready = true;
      }
    }
    if (isAlready) {
      ans.push_back(j + 1);
    }
  }
  cout << ans.size() << "\n";
  for (auto x : ans) {
    cout << x << " ";
  }
  return 0;
}
