#include <bits/stdc++.h>
using namespace std;
long long a[100001], b[100001], c[100001], i, n, k, j, l, x;
bool flag;
int main() {
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    c[i] = i;
  }
  for (i = 1; i <= n; i++) {
    cin >> x;
    flag = 0;
    for (j = 1; j <= x; j++) {
      cin >> a[j];
      if (k > a[j] && flag == 0) {
        flag = 1;
        l++;
        b[l] = i;
      }
    }
  }
  cout << l << endl;
  for (i = 1; i <= l; i++) {
    cout << b[i] << " ";
  }
  return 0;
}
