#include <bits/stdc++.h>
using namespace std;
class A {
 public:
  void solveOne(istream &in, ostream &out) {
    int n, v;
    in >> n >> v;
    set<int> s;
    for (int i = 0; i < n; ++i) {
      int x;
      in >> x;
      for (int j = 0; j < x; ++j) {
        int y;
        in >> y;
        if (v > y) {
          s.insert(i + 1);
        } else
          continue;
      }
    }
    out << s.size() << "\n";
    for (auto i : s) out << i << " ";
    out << "\n";
  }
  void solve(std::istream &in, std::ostream &out) {
    int tc = 1;
    for (int i = 0; i < tc; ++i) {
      solveOne(in, out);
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  A a;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  a.solve(in, out);
  return 0;
}
