#include <bits/stdc++.h>
using namespace std;
vector<int> solution(int n, int v, vector<vector<int>> items) {
  int total_sellers = 0;
  vector<int> index_of_sellers;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < items[i].size(); j++) {
      if (items[i][j] < v) {
        total_sellers += 1;
        index_of_sellers.push_back(i + 1);
        break;
      }
    }
  }
  index_of_sellers.push_back(total_sellers);
  return index_of_sellers;
}
int main() {
  int n, v;
  cin >> n >> v;
  vector<vector<int>> items;
  vector<int> res;
  int num;
  vector<int> seller;
  for (int i = 0; i < n; i++) {
    cin >> num;
    for (int j = 0; j < num; j++) {
      int a;
      cin >> a;
      seller.push_back(a);
    }
    items.push_back(seller);
    seller.clear();
  }
  res = solution(n, v, items);
  cout << res.back() << endl;
  for (int i = 0; i < res.size() - 1; i++) {
    cout << res[i] << " ";
  }
  return 0;
}
