#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, v;
  cin >> n >> v;
  set<long long int> s;
  for (long long int i = 0; i < n; ++i) {
    long long int k;
    cin >> k;
    long long int mn = 1000005;
    while (k--) {
      long long int a;
      cin >> a;
      mn = min(mn, a);
    }
    if (mn < v) s.insert(i + 1);
  }
  cout << s.size() << endl;
  for (auto it : s) {
    cout << it << " ";
  }
  return 0;
}
