#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v;
  while (cin >> n >> v) {
    int k;
    vector<int> c;
    for (int i = 1; i <= n; i++) {
      cin >> k;
      int s;
      bool flag = false;
      while (k--) {
        cin >> s;
        if (s < v) flag = true;
      }
      if (flag) c.push_back(i);
    }
    cout << c.size() << endl;
    if (c.size() > 0) {
      for (int i = 0; i < c.size(); i++) {
        cout << c[i];
        if (i != c.size() - 1) cout << " ";
      }
      cout << endl;
    }
  }
}
