#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<int> fin;
  for (int kk = 0; kk < n; ++kk) {
    long long sh;
    cin >> sh;
    long long arr[sh];
    for (int i = 0; i < sh; ++i) {
      cin >> arr[i];
    }
    bool flag = false;
    for (int i = 0; i < sh; ++i) {
      if (arr[i] < k) {
        flag = true;
        break;
      }
    }
    if (flag) {
      fin.push_back(kk + 1);
    }
  }
  cout << fin.size() << endl;
  for (auto i : fin) cout << i << " ";
}
