#include <bits/stdc++.h>
using namespace std;
const long long N = 234567;
const long long NN = 2345;
const long long inf = 2147483647;
bool vis[N];
signed main() {
  long long n, m;
  scanf("%lld", &n);
  scanf("%lld", &m);
  long long cnt = 0;
  for (long long(i) = (1); (i) <= (n); (i)++) {
    long long t;
    scanf("%lld", &t);
    bool flag = true;
    for (long long(j) = (1); (j) <= (t); (j)++) {
      long long tmp;
      cin >> tmp;
      if (m > tmp and flag) {
        cnt++;
        vis[i] = true;
        flag = false;
      }
    }
  }
  cout << cnt << endl;
  for (long long(i) = (1); (i) <= (100); (i)++) {
    if (vis[i]) {
      cout << i << " ";
    }
  }
}
