#include <bits/stdc++.h>
using namespace std;
long long n, w, i, g, m, p, ans, k = 1, x, x1, a[10000000];
int main() {
  cin >> n >> m;
  w = m;
  for (i = 1; i <= n; i++) {
    cin >> k;
    w = m;
    for (g = 1; g <= k; g++) {
      cin >> x;
      if (x < w) {
        w = 0;
        a[p + 1] = i;
        p++;
      }
    }
  }
  cout << p << endl;
  for (i = 1; i <= p; i++) {
    cout << a[i] << " ";
  }
}
