#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, num, sum = 0;
  cin >> n >> num;
  int a[n];
  for (int i = 0; i < n; i++) a[i] = 0;
  for (int i = 0; i < n; i++) {
    int d;
    cin >> d;
    for (int j = 0; j < d; j++) {
      long long f;
      cin >> f;
      if (f < num) a[i] = 1;
    }
    if (a[i] == 1) sum++;
  }
  cout << sum << "\n";
  if (sum != 0)
    for (int i = 0; i < n; i++)
      if (a[i] == 1) cout << i + 1 << " ";
}
