#include <bits/stdc++.h>
using namespace std;
int N, V, k, y;
vector<int> vec;
int main() {
  cin >> N >> V;
  for (int i = 1; i <= N; i++) {
    cin >> k;
    int x = 1000000000;
    for (int j = 1; j <= k; j++) {
      cin >> y;
      x = min(x, y);
    }
    if (x < V) vec.push_back(i);
  }
  cout << vec.size() << endl;
  for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
  return (0);
}
