#include <bits/stdc++.h>
using namespace std;
int out[1000];
int last = 0;
int main() {
  int n, v, ans = 0;
  scanf("%d%d", &n, &v);
  for (int i = 0; i < n; i++) {
    int count;
    scanf("%d", &count);
    bool f = false;
    for (int j = 0; j < count; j++) {
      int value;
      scanf("%d", &value);
      if (!f && value < v) {
        out[last++] = i + 1;
        ans++;
        f = true;
      }
    }
  }
  printf("%d\n", ans);
  for (int i = 0; i < last; i++) printf("%d ", out[i]);
  return 0;
}
