#include <bits/stdc++.h>
using namespace std;
int res[100];
long arr[100][10];
int main() {
  long n, v, x, y, cnt = 0;
  cin >> n >> v;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int j = 0; j < x; j++) {
      cin >> arr[i][j];
      if (arr[i][j] < v) res[i]++;
    }
  }
  for (int i = 0; i < n; i++)
    if (res[i] > 0) cnt++;
  cout << cnt << endl;
  for (int i = 0; i < n; i++)
    if (res[i] > 0) cout << i + 1 << " ";
  return 0;
}
