#include <bits/stdc++.h>
using namespace std;
int main() {
  int c = -1;
  int x, y;
  cin >> x >> y;
  int arr[100000];
  int a[x], b[x];
  int t;
  int num1 = 0, num2 = 10000000;
  for (int i = 0; i < x; i++) {
    cin >> t;
    for (int j = 0; j < t; j++) {
      cin >> num1;
      if (num1 < num2) {
        num2 = num1;
      }
    }
    if (num2 < y) {
      c++;
      arr[c] = i + 1;
    }
    num2 = 10000000;
  }
  cout << c + 1 << endl;
  for (int i = 0; i < c + 1; i++) {
    cout << arr[i] << " ";
  }
}
