#include <bits/stdc++.h>
using namespace std;
vector<int> t[50];
vector<int> ans;
vector<int> ans2;
int main() {
  int n, v, c, x;
  cin >> n >> v;
  for (int i = 0; i < n; i++) {
    cin >> c;
    for (int j = 0; j < c; j++) {
      cin >> x;
      if (x < v) ans.push_back(i + 1);
    }
  }
  if (ans.size() != 0) ans2.push_back(ans[0]);
  for (int i = 1; i < ans.size(); i++)
    if (ans[i] != ans[i - 1]) ans2.push_back(ans[i]);
  cout << ans2.size() << endl;
  for (int i = 0; i < ans2.size(); i++) cout << ans2[i] << ' ';
  return 0;
}
