#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v;
  vector<int> ans;
  scanf("%d%d", &n, &v);
  for (int i = 1; i < n + 1; ++i) {
    bool flag = false;
    int m;
    scanf("%d", &m);
    for (int j = 0; j < m; ++j) {
      int t;
      scanf("%d", &t);
      if (v > t) flag = true;
    }
    if (flag) ans.push_back(i);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) printf("%d ", ans[i]);
  return 0;
}
