#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v;
  while (cin >> n >> v) {
    vector<int> V[60];
    vector<int> res;
    for (int i = 1; i <= n; i++) {
      int k;
      cin >> k;
      while (k--) {
        int s;
        cin >> s;
        V[i].push_back(s);
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < V[i].size(); j++) {
        if (v > V[i][j]) {
          res.push_back(i);
          break;
        }
      }
    }
    if (res.size() == 0)
      cout << 0 << endl;
    else {
      cout << res.size() << endl;
      for (int i = 0; i < res.size() - 1; i++) {
        cout << res[i] << " ";
      }
      cout << res[res.size() - 1] << endl;
    }
  }
}
