#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, a, x, s, c = 0;
  bool check;
  cin >> n >> a;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> x;
    check = 0;
    for (int j = 0; j < x; j++) {
      cin >> s;
      if (a > s && check == 0) {
        c++;
        check = 1;
        v.push_back(i + 1);
      }
    }
  }
  sort(v.begin(), v.end());
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  return 0;
}
