#include <bits/stdc++.h>
using namespace std;
set<int> s;
int main(void) {
  int n, v;
  cin >> n >> v;
  int k;
  int val;
  for (int i = 1; i <= n; ++i) {
    cin >> k;
    for (int j = 0; j < k; ++j) {
      cin >> val;
      if (val < v) {
        s.insert(i);
      }
    }
  }
  if (s.size() == 0) {
    cout << 0 << endl;
    return 0;
  } else {
    cout << s.size() << endl;
    int cnt = 0;
    for (auto i : s) {
      if (cnt == 0) {
        cnt++;
        cout << i;
      } else {
        cout << " " << i;
      }
    }
    cout << endl;
  }
  return 0;
}
