Valera is a collector. Once he wanted to expand his collection with exactly one antique item.

Valera knows n sellers of antiques, the i-th of them auctioned k_{i} items. Currently the auction price of the j-th object of the i-th seller is s_{ij}. Valera gets on well with each of the n sellers. He is perfectly sure that if he outbids the current price of one of the items in the auction (in other words, offers the seller the money that is strictly greater than the current price of the item at the auction), the seller of the object will immediately sign a contract with him.

Unfortunately, Valera has only v units of money. Help him to determine which of the n sellers he can make a deal with.


-----Input-----

The first line contains two space-separated integers n, v (1 ≤ n ≤ 50; 10^4 ≤ v ≤ 10^6) — the number of sellers and the units of money the Valera has.

Then n lines follow. The i-th line first contains integer k_{i} (1 ≤ k_{i} ≤ 50) the number of items of the i-th seller. Then go k_{i} space-separated integers s_{i}1, s_{i}2, ..., s_{ik}_{i} (10^4 ≤ s_{ij} ≤ 10^6) — the current prices of the items of the i-th seller. 


-----Output-----

In the first line, print integer p — the number of sellers with who Valera can make a deal.

In the second line print p space-separated integers q_1, q_2, ..., q_{p} (1 ≤ q_{i} ≤ n) — the numbers of the sellers with who Valera can make a deal. Print the numbers of the sellers in the increasing order. 


-----Examples-----
Input
3 50000
1 40000
2 20000 60000
3 10000 70000 190000

Output
3
1 2 3

Input
3 50000
1 50000
3 100000 120000 110000
3 120000 110000 120000

Output
0




-----Note-----

In the first sample Valera can bargain with each of the sellers. He can outbid the following items: a 40000 item from the first seller, a 20000 item from the second seller, and a 10000 item from the third seller.

In the second sample Valera can not make a deal with any of the sellers, as the prices of all items in the auction too big for him.

Source: codeforces | Difficulty: EASY
Tags: Implementation


Solutions:
(n, w) = map(int, input().split())
s = 0
set_ = []
for i in range(n):
	a = list(map(int, input().split()))
	for j in range(1, len(a)):
		if w > a[j]:
			set_.append(i + 1)
			s = s + 1
			break
print(s)
print(*set_)


(n, v) = map(int, input().split())
sellers = []
for i in range(1, n + 1):
	if v > min(list(map(int, input().split()))[1:]):
		sellers.append(i)
print(len(sellers))
for i in range(len(sellers)):
	print(sellers[i], end=' ')


(n, v) = input().split()
(n, v) = (int(n), int(v))
st = set()
for i in range(n):
	m = i + 1
	lt = [int(x) for x in input().split()]
	for p in lt[1:]:
		if p < v:
			st.add(m)
print(len(st))
if len(st) != 0:
	print(*st)


a = list(map(int, input().split()))
b = [list(filter(lambda x: x < a[1], list(map(int, input().split()[1:])))) for i in range(a[0])]
c = [j + 1 for j in range(len(b)) if b[j]]
print(len(c))
print(' '.join(map(str, c)))


from collections import deque as de
import math
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping
from itertools import groupby as gb
from fractions import Fraction as fr

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def ceildiv(x, y):
	return (x + y - 1) // y

def datainput():
	return map(int, input().split())

def listinput():
	return list(map(int, input().split()))
(n, v) = datainput()
nn = n
sellercount = 0
ans = []
while n:
	n -= 1
	ll = sorted(listinput())
	if v > ll[1]:
		sellercount += 1
		ans.append(nn - n)
print(len(ans))
print(*ans)


(n, v) = map(int, input().split())
(p, c) = ([], 0)
for i in range(n):
	a = min(list(map(int, input().split()))[1:])
	if v > a:
		c += 1
		p.append(i + 1)
print(c)
print(*p)


s = input().split()
a = int(s[0])
b = int(s[1])
mat = []
for i in range(a):
	sk = input().split()
	n = list(sk[1:])
	for j in range(len(n)):
		n[j] = int(n[j])
		if n[j] < b:
			if not i + 1 in mat:
				mat.append(i + 1)
				break
mat = sorted(mat)
if len(mat) == 0:
	print(0)
else:
	print(len(mat))
	for i in mat:
		print(i, end=' ')


(a, d, c) = (list(map(int, input().split())), 0, '')
b = [a[1] + 1]
for i in range(a[0]):
	b.append(min(list(map(int, input().split()))[1:]))
for i in range(len(b)):
	if b[i] < a[1]:
		d += 1
		c += str(i) + ' '
print(d, '\n' + c)


(n, v) = map(int, input().split())
sumi = 0
ls = []
for i in range(n):
	li = list(map(int, input().split()))
	for j in range(1, len(li)):
		if v > li[j]:
			sumi = sumi + 1
			ls.append(i + 1)
			break
print(sumi)
if sumi != 0:
	print(' '.join(map(str, ls)))


(n, v) = map(int, input().split())
m = []
a = []
for i in range(n):
	a.append(input().split())
	for j in a[i][1:]:
		if int(j) < v:
			m.append(i + 1)
			break
if len(m) == 0:
	print(0)
else:
	print(len(m))
	for i in m:
		print(int(i), end=' ')


(n, v) = map(int, input().split())
order = []
for i in range(n):
	a = list(map(int, input().split()))
	a.pop(0)
	for j in a:
		if j < v:
			order.append(i + 1)
			break
print(len(order))
for i in order:
	print(i, end=' ')


(n, v) = map(int, input().split())
a = []
c = 0
for i in range(0, n):
	l = list(map(int, input().split()))
	l.remove(l[0])
	minl = min(l)
	if minl < v:
		a.append(i + 1)
		c = c + 1
print(c)
for i in a:
	print(i, end=' ')


(n, v) = map(int, input().split())
vanz = []
i = 1
while i <= n:
	l = list(map(int, input().split()))
	if v > min(l[1:]):
		vanz.append(i)
	i += 1
print(len(vanz))
for el in vanz:
	print(el, end=' ')


from array import *
(n, v) = map(int, input().split())
z = 1
arr = array('i', [])
for i in range(0, n):
	a = list(map(int, input().split()))
	flag = 0
	if min(a[1:]) < v:
		arr.append(z)
	z = z + 1
print(len(arr))
for i in arr:
	print(i, end=' ')


import math

def ost(a, b):
	if a % b != 0:
		return 1
	return 0
(n, m) = map(int, input().split())
ans = []
for i in range(n):
	data = list(map(int, input().split()))
	data.sort()
	if data[1] < m:
		ans.append(i + 1)
print(len(ans))
print(' '.join(map(str, ans)))


def main():
	(n, v) = map(int, input().split())
	out = []
	for i in range(n):
		s = list(map(int, input().split()))
		s = s[1:]
		if min(s) < v:
			out.append(i + 1)
	print(len(out))
	print(' '.join((str(x) for x in out)))
main()


X = list(map(int, input().split(' ')))
M = []
for I in range(0, X[0]):
	Y = list(map(int, input().split(' ')))
	Z = min(Y[1:])
	if X[1] > Z:
		M.append(str(I + 1))
print(len(M))
print(' '.join(M))


(n, v) = map(int, input().split())
out = []
for i in range(n):
	items = list(map(int, input().split()))
	k = items[0]
	items = sorted(items[1:])
	if items[0] < v:
		out.append(i + 1)
print(len(out))
print(*out)


(n, v) = list(map(int, input().split()))
count = 0
res = []

def f(a):
	for k in a:
		if v > k:
			return True
	return False
for i in range(n):
	a = list(map(int, input().split(' ')))
	a.pop(0)
	if f(a):
		count += 1
		res.append(i + 1)
print(count)
print(' '.join((str(e) for e in res)))


st = [int(i) for i in input().split(' ')]
n = st[0]
v = st[1]
b = []
k = 0
a = []
for i in range(n):
	k = 0
	a = [int(n) for n in input().split()]
	a = a[1:]
	for j in range(len(a)):
		if a[j] < v:
			k += 1
	if k > 0:
		b.append(i + 1)
print(len(b))
if len(b) != 0:
	for i in range(len(b)):
		print(b[i], sep=' ', end=' ')


import sys
import math
import collections
import heapq
input = sys.stdin.readline
(n, v) = (int(i) for i in input().split())
l = []
c = 0
for i in range(n):
	l1 = sorted([int(i) for i in input().split()])
	if len(l1) == 2:
		if l1[1] < v:
			c += 1
			l.append(i + 1)
	elif l1[1] < v:
		c += 1
		l.append(i + 1)
print(c)
print(*l)


(n, v) = map(int, input().split())
mat = []
arr = []
for i in range(n):
	mat.append(list(map(int, input().split())))
for i in range(len(mat)):
	for j in range(1, mat[i][0] + 1):
		if mat[i][j] < v:
			arr.append(i + 1)
			break
print(len(arr))
for i in arr:
	print(i, end=' ')


(n, v) = map(int, input().split())
sell = []
for j in range(n):
	s = input().split()
	k = int(s[0])
	x = []
	for i in range(k):
		x.append(int(s[i + 1]))
	for i in range(k):
		if v > x[i]:
			sell.append(j + 1)
			break
print(len(sell))
for i in sell:
	print(i, end=' ')


(n, k) = map(int, input().split())
z = []
count = 0
for i in range(1, n + 1):
	l = list(map(int, input().split()))
	for j in range(1, l[0] + 1):
		if l[j] < k:
			z.append(i)
			break
print(len(z))
if len(z) > 0:
	print(*z)


(n, v) = map(int, input().split())
ans = []
for i in range(n):
	x = list(map(int, input().split()))
	n1 = x[0]
	v1 = x[1:]
	v1.sort()
	if v1[0] < v:
		ans.append(i + 1)
print(len(ans))
if len(ans) > 0:
	ans.sort()
	print(' '.join(list(map(str, ans))))


(n, v) = map(int, input().split())
s = []
for i in range(1, n + 1):
	if v > min(map(int, input().split()[1:])):
		s.append(str(i))
print(len(s))
print(' '.join(s))


arr = input().split(' ')
numSellers = int(arr[0])
money = int(arr[1])
pricesArr = []
for i in range(0, numSellers):
	sellerAndPrice = input().split(' ')
	for j in range(1, len(sellerAndPrice)):
		if int(sellerAndPrice[j]) < money:
			pricesArr.append(str(i + 1))
			break
availableSellers = len(pricesArr)
print(str(availableSellers) + '\n' + ' '.join(pricesArr))


(n, m) = input().split()
n = int(n)
m = int(m)
l = []
for i in range(n):
	t = input().split()
	for s in range(1, len(t)):
		if m > int(t[s]):
			l.append(i + 1)
			break
print(len(l))
l.sort()
for i in l:
	print(i, end=' ')
print()


X = list(map(int, input().split()))
Sellers = list()
for i in range(X[0]):
	Y = list(map(int, input().split()))
	for j in range(1, len(Y)):
		if Y[j] < X[1]:
			Sellers.append(i + 1)
			break
print(len(Sellers))
print(*Sellers)


(n, v) = list(map(int, input().split()))
l = []
for i in range(n):
	k = list(map(int, input().split()))
	if any((i < v for i in k[1:])):
		l.append(i + 1)
l.sort()
print(len(l))
print(*l)


(n, v) = map(int, input().split())
s = []
c = 0
for i in range(n):
	a = list(map(int, input().split()))
	for j in range(1, len(a)):
		if v > a[j]:
			s.append(i + 1)
			break
		else:
			pass
print(len(s))
for i in s:
	print(i, end=' ')


(n, v) = map(int, input().split())
ans = []
for x in range(n):
	a = list(map(int, input().split()))
	for i in range(1, len(a)):
		if a[i] < v:
			ans.append(x + 1)
			break
print(len(ans))
print(' '.join(map(str, ans)))


(x, y) = map(int, input().split())
s = ''
cnt = 0
for i in range(x):
	lst = list(map(int, input().split()))
	if y > min(lst[1:]):
		cnt += 1
		s += str(i + 1) + ' '
print(str(cnt) + '\n' + s)


R = lambda : list(map(int, input().split()))
(n, v) = R()
k = []
for i in range(n):
	(h, *l) = R()
	for j in l:
		if j < v:
			k.append(i + 1)
			break
if len(k) == 0:
	print(0)
else:
	print(len(k))
	print(*k)


(n, v) = map(int, input().split())
res = []
for i in range(n):
	s = list(map(int, input().split()))
	s.pop(0)
	if any((x < v for x in s)):
		res.append(i + 1)
print(len(res))
print(' '.join(map(str, res)))


import sys
(n, v) = map(int, sys.stdin.readline().split())
ans = []
for i in range(1, n + 1):
	alist = list(map(int, sys.stdin.readline().split()))
	if min(alist[1:]) < v:
		ans.append(i)
print(len(ans))
if ans:
	print(' '.join((str(i) for i in ans)))


import sys
import bisect
(n, have) = map(int, input().split())
l = []
for i in range(n):
	ml = list(map(int, input().split()))
	ml.pop(0)
	l.append(ml)
ans = []
cnt = 1
for i in l:
	for j in i:
		if j < have:
			ans.append(cnt)
			break
	cnt += 1
print(len(ans))
for i in ans:
	print(i, end=' ')


(n, v) = map(int, input().split())
l = []
for i in range(n):
	l1 = list(map(int, input().split()))
	t = l1[1:]
	y = t[:]
	y.sort()
	if y[0] + 1 <= v:
		l.append(i + 1)
print(len(l))
print(*l)


(n, v) = list(map(int, input().rstrip().split()))
ans = []
for i in range(n):
	a = list(map(int, input().rstrip().split()))
	li = a[1:]
	minm = min(li)
	if minm < v:
		ans += [i + 1]
ans.sort()
m = len(ans)
print(m)
for i in range(m):
	print(ans[i], end=' ')


(n, v) = map(int, input().split())
p = 0
k = []
for z in range(n):
	l = list(map(int, input().split()))
	l.pop(0)
	l = sorted(l)
	if v > l[0]:
		p += 1
		k.append(z + 1)
print(p)
print(*k)


a = [int(x) for x in input().split()]
c = []
for i in range(a[0]):
	b = [int(x) for x in input().split()]
	c.append(min(b[1:]))
count = 0
for i in range(a[0]):
	if c[i] < a[1]:
		count = count + 1
print(count)
for i in range(a[0]):
	if c[i] < a[1]:
		print(i + 1, end=' ')


(n, m) = map(int, input().split())
o = []
for i in range(n):
	a = list(map(int, input().split()))
	t = 10 ** 9
	for j in range(1, len(a)):
		t = min(t, a[j])
	if t < m:
		o.append(i + 1)
print(len(o))
for i in range(len(o)):
	print(o[i], end=' ')


(n, v) = map(int, input().split())
seller = []
for i in range(n):
	li = list(map(int, input().split()))
	for j in range(1, li[0] + 1):
		if v > li[j]:
			seller.append(i + 1)
			break
seller.sort(key=None, reverse=False)
print(len(seller))
for i in range(len(seller)):
	print(seller[i], end=' ')


R = lambda : list(map(int, input().split()))
(n, v) = R()
s = [min(R()[1:]) for i in range(n)]
s = [i + 1 for i in range(n) if s[i] < v]
print(len(s))
print(' '.join(map(str, s)))


__author__ = 'DOAN Minh Quy'
line = input().split()
n = int(line[0])
v = int(line[1])

def run():
	for i in range(n):
		line = input().split()
		k = int(line[0])
		for j in range(1, k + 1):
			if int(line[j]) < v:
				yield (i + 1)
				break
result = []
for x in run():
	result.append(x)
print(len(result))
for x in result:
	print(x, end=' ')


(tc, budget) = map(int, input().split())
ans = []
count = 0
for i in range(tc):
	l = [int(x) for x in input().split()]
	for x in range(1, len(l)):
		if l[x] < budget:
			count += 1
			ans.append(i + 1)
			break
print(count)
print(*ans)


(n, v) = map(int, input().split())
a = list()
b = list()
for i in range(n):
	a.append([int(i) for i in input().split()])
y = 0
for i in range(n):
	for j in range(1, len(a[i])):
		if a[i][j] < v:
			y += 1
			b.append(i)
			break
print(y)
for i in range(len(b)):
	print(b[i] + 1, end=' ')


(n, v) = (int(i) for i in input().split())
(p, c) = (0, [])
for j in range(n):
	(_, *v_) = (int(i) for i in input().split())
	if any((i < v for i in v_)):
		p += 1
		c.append(j + 1)
print(p)
print(' '.join((str(i) for i in sorted(c))))


ans = []
l = input().split()
n = int(l[0])
v = int(l[1])
for i in range(n):
	st = input().split()
	num = int(st[0])
	for j in range(1, num + 1):
		cur = int(st[j])
		if cur < v:
			ans.append(i + 1)
			break
print(len(ans))
res = ''
for i in ans:
	res += str(i) + ' '
print(res)


l1 = [int(x) for x in input().split()]
t = l1[0]
v = l1[1]
ans = []
for _ in range(t):
	l2 = [int(x) for x in input().split()]
	if min(l2[1:]) < v:
		ans.append(_ + 1)
print(len(ans))
print(*ans)


(n, v) = map(int, input().split())
c = 0
p = []
for i in range(n):
	L = input().split()
	mi = 1000000
	for j in range(1, int(L[0]) + 1):
		if int(L[j]) < mi:
			mi = int(L[j])
	if mi < v:
		c += 1
		p.append(i + 1)
print(c)
if c > 0:
	print(*p, sep=' ')


(n, v) = map(int, input().split())
a = [i + 1 for i in range(n) if min(map(int, input().split()[1:])) < v]
print(len(a))
print(*a)


(t, m) = [int(x) for x in input().split()]
d = []
for i in range(t):
	if min([int(x) for x in input().split()][1:]) < m:
		d.append(str(i + 1))
print(len(d))
print(' '.join(d))


(n, v) = list(map(int, input().split()))
y = []
for j in range(n):
	h = list(map(int, input().split()))
	if v > min(h[1:]):
		y.append(j + 1)
print(len(y))
b = list(set(y))
print(*b)


(n, v) = map(int, input().split())
s = set()
for p in range(0, n):
	(x, *a) = map(int, input().split())
	for i in a:
		if i < v:
			s.add(p + 1)
if len(s) == 0:
	print(0)
else:
	print(len(s))
	print(' '.join((str(x) for x in s)))


(n, v) = map(int, input().split())
count = 0
lis = []
for i in range(n):
	k = list(map(int, input().split()))
	del k[0]
	for el in k:
		if el < v:
			lis.append(i + 1)
			count += 1
			break
print(count)
for i in lis:
	print(i, end=' ')


(n, v) = map(int, input().split())
l = []
for i in range(n):
	s = list(map(int, input().split()))
	del s[0]
	s.sort()
	if s[0] + 1 <= v:
		l.append(i + 1)
print(len(l))
print(*l)


(n, v) = map(int, input().split())
Dict = {}
List = []
for i in range(1, n + 1):
	s = list(map(int, input().split()))
	Dict[i] = list(sorted(s[1:]))
for i in range(1, n + 1):
	if Dict[i][0] < v:
		List.append(i)
print(len(List))
print(*List)


(n, v) = map(int, input().strip().split(' '))
(count, sell_list) = (0, [])
for i in range(n):
	arr = list(map(int, input().strip().split(' ')))
	k = arr.pop(0)
	if v > min(arr):
		count += 1
		sell_list.append(i + 1)
sell_list.sort()
print(count)
for i in sell_list:
	print(i, end=' ')


(n, v) = input().split()
n = int(n)
v = int(v)
m = 0
l = []
for i in range(n):
	l2 = input().split()
	l1 = int(l2[0])
	l2.pop(0)
	for j in range(l1):
		if int(l2[j]) < v:
			m += 1
			l.append(i + 1)
			break
print(m)
for i in range(m):
	print(l[i], '', end='')


(n, amount) = map(int, input().split())
i = 0
c = 0
st = ''
while i != n:
	l = list(map(int, input().split()))
	for _ in range(1, len(l)):
		if l[_] < amount:
			st = st + str(i + 1) + ' '
			c = c + 1
			break
	i += 1
print(c)
print(st)


(n, v) = map(int, input().split())
price = []
for _ in range(n):
	b = list(map(int, input().split()))
	price.append(b[1:])
(count, op) = (0, [])
for i in price:
	for j in i:
		if j < v:
			count += 1
			op.append(price.index(i) + 1)
			break
print(count)
for k in op:
	print(k, end=' ')


(n, m) = input().split(' ')
n = int(n)
m = int(m)
c = []
d = 0
e = []
for i in range(n):
	c.append([])
	a = input().split(' ')
	for j in range(int(a[0]) + 1):
		c[i].append(int(a[j]))
for i in range(n):
	d = 0
	for j in range(1, len(c[i])):
		if c[i][j] < m:
			d += 1
			break
	if d == 1:
		e.append(i + 1)
print(len(e))
for i in range(len(e)):
	print(e[i], end=' ')


(n, m) = map(int, input().split())
l = []
count = 0
for i in range(n):
	x = list(map(int, input().split()))
	if min(x[1:]) < m:
		l.append(str(i + 1))
		count += 1
print(count)
print(' '.join(l))


inp = lambda : map(int, input().split())
(n, v) = inp()
a = [str(i + 1) for i in range(n) if v > min(list(inp())[1:])]
print(len(a))
print(' '.join(a))


(n, v) = map(int, input().split())
a = []
count = 0
for i in range(1, n + 1):
	k = list(map(int, input().split()))
	s = k[1:]
	x = sorted(s)
	if x[0] < v:
		count += 1
		a.append(str(i))
print(count)
print(' '.join(a))


def antikvariat(lst, v):
	d = list()
	for elem in lst:
		for i in elem[1:]:
			if v > i:
				d.append(lst.index(elem) + 1)
	return (len(list(set(d))), sorted(list(set(d))))
(n, w) = [int(j) for j in input().split()]
a = list()
for x in range(n):
	b = [int(y) for y in input().split()]
	a.append(b)
print(antikvariat(a, w)[0])
print(*antikvariat(a, w)[1])


def count(arr, value):
	c = 0
	for ai in arr:
		if ai < value:
			c += 1
	return c
(n, v) = list(map(int, input().split()))
sellers = []
for _ in range(n):
	prices = list(map(int, input().split()))[1:]
	prices.sort()
	sellers.append(prices)
outbid = []
for (i, prices) in enumerate(sellers):
	if count(prices, v) > 0:
		outbid.append(i + 1)
seller_count = len(outbid)
print(seller_count)
if seller_count > 0:
	for out in outbid:
		print(out, end=' ')
else:
	print()


[n, v] = input().split()
arr = []
v = int(v)
for i in range(int(n)):
	a = input().split()
	a.pop(0)
	for el in a:
		if int(el) < v:
			arr.append(i + 1)
			break
print(len(arr))
for el in arr:
	print(el, end=' ')


def read(mode=2):
	inputs = input().strip()
	if mode == 0:
		return inputs
	if mode == 1:
		return inputs.split()
	if mode == 2:
		return [int(x) for x in inputs.split()]

def write(s='\n'):
	if isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='')
(k, v) = read()
res = []
for i in range(k):
	a = read()
	n = a.pop(0)
	if min(a) < v:
		res.append(i + 1)
print(len(res))
write(res)


(n, c) = map(int, input().split())
ans = []
for i in range(n):
	if c > min(list(map(int, input().split()))[1:]):
		ans.append(i + 1)
print(len(ans))
print(*ans)


(n, v) = map(int, input().split())
l = []
for _ in range(n):
	l.append(list(map(int, input().split())))
nos = 0
lp = []
for i in range(n):
	for j in range(1, len(l[i])):
		if l[i][j] < v:
			nos += 1
			lp.append(i + 1)
			break
print(nos)
print(*lp, sep=' ')


(x, y) = input().split()
a = int(x)
b = int(y)
c = []
list = []
for i in range(a):
	a = [int(x) for x in input().split()]
	list.append(a)
d = len(list)
for k in range(d):
	count = 0
	for j in range(list[k][0] + 1):
		try:
			z = list[k][j + 1]
		except:
			continue
		if max(b, z) == b and z != b:
			count = count + 1
	if count > 0:
		c.append(k + 1)
print(len(c))
for i in c:
	print(i, end=' ')


def fun(n, v, li):
	ans = [0]
	for i in range(n):
		if v > min(li[i][1:]):
			ans.append(i + 1)
	if len(ans) > 1:
		print(len(ans) - 1)
		for i in ans[1:]:
			print(i, end=' ')
	else:
		print(0)
(n, v) = list(map(lambda x: int(x), input().split()))
li = [list(map(lambda x: int(x), input().split())) for _ in range(n)]
fun(n, v, li)


(n, v) = [int(i) for i in input().split()]
s = [[] for i in range(50)]
q = []
p = 0
for i in range(n):
	s[i] = [int(x) for x in input().split()]
	s[i].pop(0)
	if min(s[i]) < v:
		p += 1
		q.append(i + 1)
print(p)
print(*q)


(n, k) = map(int, input().split())
x = []
for t in range(n):
	a = list(map(int, input().split()))
	c = -1
	for i in range(1, len(a)):
		if a[i] < k:
			c = 0
			break
	if c == 0:
		x.append(t + 1)
print(len(x))
for i in sorted(x):
	print(i, end=' ')


(n, v) = str(input()).split()
n = int(n)
v = int(v)
line = list()
for i in range(n):
	temp_list = str(input()).split()
	temp_list = [int(it) for it in temp_list]
	temp_list.sort()
	if temp_list[1] < v:
		line.append(i + 1)
length = len(line)
if length > 0:
	line.sort()
	line = [str(it) for it in line]
	print(length)
	print(' '.join(line))
else:
	print(0)


(n, m) = [int(i) for i in input().split()]
l = []
for i in range(n):
	flag = 0
	a = [int(i) for i in input().split()]
	for j in range(1, len(a)):
		if a[j] < m:
			flag = 1
			break
	if flag == 1:
		l.append(i + 1)
print(len(l))
print(*sorted(l))


l1 = input().split()
n = int(l1[0])
v = int(l1[1])
ans = []
for x in range(n):
	l = input().split()
	k = int(l[0])
	for s in range(k):
		if int(l[s + 1]) < v:
			ans.append(x + 1)
ans = sorted(list(set(ans)))
print(len(ans))
for x in range(len(ans)):
	print(ans[x], end=' ')


(a, b) = map(int, input().split())
buy = []
for i in range(a):
	vendors = list(map(int, input().split()))
	for j in range(len(vendors) - 1):
		if vendors[j + 1] < b:
			buy.append(i + 1)
			break
print(len(buy))
if len(buy) != 0:
	print(*sorted(buy), sep=' ')


(n, v) = list(map(int, input().split()))
s = []
for i in range(n):
	(x, k) = input().split(maxsplit=1)
	k = list(map(int, k.split()))
	if v > min(k):
		s.append(i + 1)
print(len(s))
print(' '.join(map(str, s)))


n = input()
l = []
l = n.split(' ')
m = int(l[1])
main1 = []
for a in range(int(l[0])):
	b = []
	y = []
	c = input()
	y = c.split(' ')
	for i in range(int(y[0])):
		b.append(int(y[i + 1]))
	main1.append(b)
p = []
for x in range(len(main1)):
	if m > min(main1[x]):
		p.append(x + 1)
p.sort()
if p != []:
	print(len(p))
	for a in p:
		print(a, end=' ')
else:
	print(0)


(n, v) = map(int, input().split())
mat = []
for i in range(n):
	l = list(map(int, input().split()))
	mat.append(l[1:])
ans = 0
ans1 = []
for i in range(len(mat)):
	for j in range(len(mat[i])):
		if v > mat[i][j]:
			ans += 1
			ans1.append(i + 1)
			break
print(ans)
print(*sorted(ans1))


(n, v) = map(int, input().split())
z = []
for i in range(n):
	l = list(map(int, input().split()))
	for j in range(1, len(l)):
		if l[j] < v:
			z.append(i + 1)
			break
if len(z) == 0:
	print(0)
else:
	print(len(z))
	print(*z)


from sys import stdin, stdout
from collections import deque
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007

def solve():
	(n, v) = mp()
	ans = []
	for i in range(1, n + 1):
		l = li()
		if min(l[1:]) < v:
			ans.append(i)
	print(len(ans))
	print(*sorted(ans))
for _ in range(1):
	solve()


(n, v) = list(map(int, input().split(' ')))
x = lambda k: int(k) < v
o = []
for i in range(n):
	m = list(map(x, input().split(' ')[1:]))
	if any(m):
		o.append(i + 1)
print(len(o))
for i in o:
	print(i, end=' ')


(t, v) = map(int, input().split())
sellers_to_deal = []
for i in range(t):
	for (j, k) in enumerate(map(int, input().split())):
		if j > 0 and k < v:
			sellers_to_deal.append(str(i + 1))
			break
print(len(sellers_to_deal))
if sellers_to_deal:
	print(' '.join(sellers_to_deal))


def cal(l, v):
	for i in range(1, l[0] + 1):
		if l[i] < v:
			return True
	return False
(n, v) = map(int, input().split())
ans = []
Len = 0
for i in range(n):
	if cal([*map(int, input().split())], v):
		ans.append(i + 1)
		Len += 1
print(Len)
print(*ans)


import sys

def main():
	(n, amount) = [int(x) for x in sys.stdin.readline().split()]
	sellers = []
	for i in range(n):
		array = [int(x) for x in sys.stdin.readline().split()]
		for x in range(1, len(array)):
			if array[x] < amount and (len(sellers) == 0 or sellers[len(sellers) - 1] != i + 1):
				sellers.append(i + 1)
	print(len(sellers))
	for x in sellers:
		print(x, end=' ')
main()


(n, m) = map(int, input().split())
b = []
for i in range(n):
	if min(list(map(int, input().split()))[1:]) < m:
		b.append(i + 1)
if len(b) == 0:
	print(0)
else:
	print(len(b), '\n', *b)


min = 0
lst = []
jjj = 0
totally = 0
fl = []
try:
	S = list(map(int, input().split()))
	N = S[0]
	total = S[1]
	for _ in range(N):
		A = list(map(int, input().split()))
		for i in range(len(A)):
			if i == 0:
				continue
			elif i == 1:
				min = A[i]
			elif min > A[i]:
				min = A[i]
		lst.append(min)
	abc = lst.copy()
	lst.sort()
	for i in lst:
		if i < total:
			totally += 1
			fl.append(abc.index(i))
		else:
			break
	print(totally)
	fl.sort()
	for i in fl:
		print(i + 1, end=' ')
except:
	pass


from sys import stdin, stdout, stderr, setrecursionlimit
setrecursionlimit(100000)

def debug(*e):
	if not __debug__:
		print(*e, file=stderr)

def dd(*vals):
	import inspect, re
	frame = inspect.getframeinfo(inspect.stack()[1][0])
	vs = re.search('dd\\((.+)\\)', frame.code_context[0]).group(1).split(',')
	if vs:
		debug(','.join(('{0} = {1}'.format(vs[i], v) for (i, v) in enumerate(vals))))

def trace(f):

	def traced(*args, **kw):
		debug('calling {} with args {}, {}'.format(f.__name__, args, kw))
		return f(*args, **kw)
	return traced

def read():
	return stdin.readline().rstrip()

def readarr(sep=None, maxsplit=-1):
	return read().split(sep, maxsplit)

def readint():
	return int(read())

def readintarr(sep=None, maxsplit=-1):
	return [int(a) for a in readarr(sep, maxsplit)]

def write(*args, **kwargs):
	sep = kwargs.get('sep', ' ')
	end = kwargs.get('end', '\n')
	stdout.write(sep.join((str(a) for a in args)) + end)

def writearr(arr, sep=' ', end='\n'):
	stdout.write(sep.join((str(a) for a in arr)) + end)
(n, v) = readintarr()
r = []
for seller in range(1, n + 1):
	(nx, *x) = readintarr()
	for i in range(nx):
		if x[i] < v:
			r.append(seller)
			break
r.sort()
write(len(r))
write(' '.join((str(c) for c in r)))


(n, v) = (int(x) for x in input().split())
ans = []
for i in range(n):
	arr = [int(x) for x in input().split()]
	for j in arr[1:]:
		if j < v:
			ans.append(i + 1)
			break
print(len(ans))
print(' '.join([str(s) for s in ans]))


(n, m) = map(int, input().split())
b = [i + 1 for i in range(n) if min(tuple(map(int, input().split()))[1:]) < m]
print(len(b), *b)


s = input().split()
(n, v) = (int(s[0]), int(s[1]))
p = 0
ans = []
for i in range(n):
	s = input().split()
	k = int(s[0])
	for j in range(k):
		if int(s[j + 1]) < v:
			p = p + 1
			ans.append(i + 1)
			break
print(p)
print(*ans, sep=' ')


def canBuy(items, v):
	for i in items:
		if v > i:
			return True
	return False
data = input().split()
n = int(data[0])
v = int(data[1])
sellers = {}
for i in range(1, n + 1):
	data = input().split()
	sellers[i] = data[1:]
	for (j, k) in enumerate(sellers[i]):
		sellers[i][j] = int(k)
count = 0
canAfford = []
for seller in sellers:
	if canBuy(sellers[seller], v):
		count += 1
		canAfford.append(seller)
print(count)
for seller in canAfford:
	print(seller, end=' ')


(ns, m) = map(int, input().split())
c = 0
v = []
for i in range(ns):
	l = [int(i) for i in input().split()]
	l.pop(0)
	l.sort()
	for k in l:
		if k < m:
			c = c + 1
			v.append(i + 1)
			break
if c == 0:
	print('0')
else:
	print(c)
	for i in v:
		print(i, end=' ')


(n, v) = map(int, input().split())
deals = []
sellers = []
sellers_count = 0
for i in range(n):
	deals.append(list(map(int, input().split())))
for k in range(len(deals)):
	for i in range(len(deals[k])):
		if i == 0:
			continue
		if deals[k][i] < v:
			if k + 1 not in sellers:
				sellers_count += 1
				sellers.append(k + 1)
print(sellers_count)
for k in range(sellers_count):
	print(sellers[k], end=' ')


temp = input()
temp = temp.split()
sellers = int(temp[0])
money = int(temp[1])
order = []
for x in range(sellers):
	temp = input()
	temp = temp.split()
	temp = [int(z) for z in temp]
	for y in temp[1:]:
		if money > y:
			order.append(x + 1)
			break
if len(order) == 0:
	print('0')
else:
	print(len(order))
	for x in order:
		print(x, end=' ')


from sys import stdin

def main():
	(n, v) = map(int, stdin.readline().strip().split())
	res = []
	for i in range(n):
		l = list(map(int, stdin.readline().strip().split()))
		nn = l.pop(0)
		if any((e < v for e in l)):
			res.append(i + 1)
	res.sort()
	print(len(res))
	print(*res)
main()


(n, v) = map(int, input().split())
cnt = 0
ans = []
for i in range(1, n + 1):
	arr = list(map(int, input().split()))
	smallest = 10 ** 7
	for j in range(1, arr[0] + 1):
		if arr[j] < smallest:
			smallest = arr[j]
	if v > smallest:
		cnt += 1
		ans.append(i)
print(cnt)
for i in ans:
	print(i, end=' ')


(n, v) = map(int, input().split())
answer = []
for i in range(n):
	a = list(map(int, input().split()))[1:]
	if v > min(a):
		answer.append(i + 1)
print(len(answer))
print(*answer)


(n, v) = map(int, input().split())
ans = []
for i in range(n):
	seller = list(map(int, input().split()))
	if min(seller[1:]) < v:
		ans.append(i + 1)
if len(ans) > 0:
	print(len(ans))
	print(*ans)
else:
	print(0)


(n, v) = map(int, input().split())
l1 = []
for i in range(n):
	l = list(map(int, input().split()))
	if min(l[1:]) < v:
		l1.append((i, min(l[1:])))
sorted(l1, key=lambda l1: l1[1])
print(len(l1))
for i in l1:
	print(i[0] + 1, end=' ')


def main():
	[n, v] = [int(_) for _ in input().split()]
	solutions = []
	for i in range(n):
		try:
			next((item for item in [int(_) for _ in input().split()][1:] if item < v))
			solutions += [i + 1]
		except StopIteration:
			pass
	print(len(solutions))
	print(' '.join([str(s) for s in solutions]))
main()


(n, v) = map(int, input().split())
c = 0
o = []
for i in range(n):
	a = list(map(int, input().split()))
	for j in range(1, a[0] + 1):
		if a[j] < v:
			c += 1
			o.append(i + 1)
			break
print(c)
for k in o:
	print(k, end=' ')


(N, V) = map(int, input().split(' '))
L = []
for i in range(N):
	now = list(map(int, input().split(' ')))
	for j in range(1, len(now)):
		if now[j] < V:
			L.append(str(i + 1))
			break
print(len(L))
print(' '.join(L))


import math

def solve():
	count = 0
	(n, v) = list(map(int, input().strip().split()))
	not_found = True
	sellers = []
	for i in range(1, n + 1):
		line = list(map(int, input().strip().split()))
		min_price = sorted(line[1:])[0]
		if min_price < v:
			count += 1
			sellers.append(i)
	if count:
		print(count)
		print(*sellers)
	else:
		print(count)
solve()


(n, m) = map(int, input().split())
s = 0
q = []
for i in range(n):
	a = list(map(int, input().split()))
	for j in range(1, a[0] + 1):
		if m > a[j]:
			s += 1
			q.append(i + 1)
			break
print(s)
print(*q)


(n, v) = input().split()
n = int(n)
v = int(v)
sellers = []
for l in range(n):
	k = input().split()
	for j in range(int(k[0])):
		i = j + 1
		if int(k[i]) < v:
			m = l + 1
			sellers.append(m)
			break
output = ''
for i in range(len(sellers)):
	output += str(sellers[i]) + ' '
print(len(sellers))
print(output)


from collections import defaultdict
d = {}
(t, v) = map(int, input().split())
k = 1
for _ in range(t):
	vals = list(map(int, input().split()))
	vals.remove(vals[0])
	for val in vals:
		d.setdefault(k, []).append(val)
	k += 1
count = 0
ans = []
for i in range(1, t + 1):
	if v > min(d[i]):
		count += 1
		ans.append(i)
print(count)
print(*ans)


(n, v) = [int(i) for i in input().split()]
ans = []
for i in range(n):
	cur = [int(i) for i in input().split()]
	if min(cur[1:]) < v:
		ans.append(i + 1)
print(len(ans))
print(*ans)


(n, v) = map(int, input().split())
pos = []
for i in range(n):
	s = list(map(int, input().split()))
	k = s[0]
	del s[0]
	for j in range(k):
		if v > s[j]:
			pos.append(i + 1)
			break
		else:
			continue
print(len(pos))
if len(pos) != 0:
	print(' '.join(map(str, pos)))


(n, v) = map(int, input().split())
list1 = []
for i in range(n):
	list1.append(list(map(int, input().split())))
list2 = []
count = 0
k = 0
for i in list1:
	for j in i[1:]:
		if j < v:
			list2.append(k + 1)
			count += 1
			break
	k += 1
print(count)
for i in list2:
	print(i, end=' ')


from sys import stdin as cin
from fractions import Fraction as f
import math
(n, v) = map(int, cin.readline().split())
r = []
for t in range(n):
	a = list(map(int, cin.readline().split()))
	for i in range(1, a[0] + 1):
		if a[i] < v:
			r.append(t + 1)
			break
print(len(r))
for x in r:
	print(x, end=' ')


o = []
x = []
ans = 0
(n, v) = map(int, input().split())
for i in range(n):
	k = {}
	(a, *l) = list(map(int, input().split()))
	k[a] = l
	o.append(k)
q = 0
for i in o:
	q += 1
	for j in i.values():
		for t in j:
			if t < v:
				ans += 1
				if q not in x:
					x.append(q)
				break
print(ans)
print(*x)


(n, v) = map(int, input().split())
array = []
for i in range(n):
	s = list(map(int, input().split()))
	k = s[0]
	del s[0]
	for j in range(k):
		if s[j] + 1 <= v:
			array.append(i)
			break
print(len(array))
array.sort()
for i in range(len(array)):
	print(array[i] + 1, end=' ')


def main():
	ans = []
	(n, v) = map(int, input().split())
	for i in range(1, n + 1):
		if v > min(map(int, input().split()[1:])):
			ans.append(str(i))
	print(len(ans))
	print(' '.join(ans))
main()


(n, v) = map(int, input().split())
a = []
lis = []
for i in range(n):
	lis = list(map(int, input().split()))
	for j in range(1, lis[0] + 1):
		if lis[j] < v:
			a.append(i + 1)
			break
ans = len(a)
print(ans)
for i in a:
	print(i, end=' ')


import sys
f = sys.stdin
(n, v) = map(int, f.readline().strip().split())
p = []
for i in range(n):
	a = [int(u) for u in f.readline().strip().split()]
	for w in a[1:]:
		if w < v:
			p.append(str(i + 1))
			break
print(len(p))
print(' '.join(p))


import sys
(n, v) = [int(x) for x in sys.stdin.readline().split()]
result = []
for i in range(n):
	if min([int(x) for x in sys.stdin.readline().split()[1:]]) < v:
		result.append(str(i + 1))
if not result:
	print(0)
else:
	print(len(result))
	print(' '.join(result))


(n, p) = list(map(int, input().split()))
count = 0
lst = []
for i in range(n):
	(a, *temp) = list(map(int, input().split()))
	for e in temp:
		if p > e:
			count += 1
			lst.append(i + 1)
			break
print(count)
print(*lst)


(n, v) = [int(i) for i in input().split()]
res = []
for i in range(n):
	(k, *lst) = [int(i) for i in input().split()]
	for j in lst:
		if j < v:
			res.append(str(i + 1))
			break
print(len(res))
print(' '.join(res))


(n, s) = map(int, input().split())
q = []
for i in range(n):
	(k, *si) = list(map(int, input().split()))
	if min(si) < s:
		q.append(i + 1)
print(len(q))
if len(q) > 0:
	print(*q)


(n, m) = [*map(int, input().split())]
ans = []
for i in range(n):
	a = [*filter(lambda x: x < 0, map(lambda x: int(x) - m, input().split()[1:]))]
	if len(a) > 0:
		ans.append(i + 1)
print(len(ans))
for i in ans:
	print(i, end=' ')
print()


(n, v) = list(map(int, input().split()))
z = []
for i in range(n):
	for k in input().split()[1:]:
		if v > int(k):
			z.append(str(i + 1))
			break
print(len(z))
print(' '.join(z))


(n, v) = list(map(int, input().split()))
count = 0
b = []
i = 1
while i <= n:
	a = list(map(int, input().split()))
	a.remove(a[0])
	if v > min(a):
		count += 1
		b.append(i)
	i += 1
if count > 0:
	print(count)
	for x in b:
		print(x, end=' ')
else:
	print(0)


import sys
import math as m

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l
mod = int(1000000000.0) + 7

def sinp():
	return sys.stdin.readline().strip()

def iinp():
	return int(input())

def ninp():
	return map(int, sys.stdin.readline().strip().split())

def linp():
	return list(map(int, sys.stdin.readline().strip().split()))

def p(a):
	print(a)

def p2(a, b):
	print(a, b)
(n, v) = ninp()
cnt = 0
l = []
ind = 1
for i in range(n):
	a = linp()
	for i in range(1, len(a)):
		if v > a[i]:
			cnt += 1
			l.append(ind)
			break
	ind += 1
print(cnt)
print(*l)


(n, v) = map(int, input().split())
c = 0
s = []
for i in range(n):
	arr = [int(x) for x in input().split()]
	arr = arr[1:]
	for j in arr:
		if v > j:
			s.append(i + 1)
			c += 1
			break
print(c)
if s == []:
	print()
else:
	print(*s, sep=' ')


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(n, v) = get_ints()
ans = []
count = 0
for i in range(n):
	Arr = get_array()
	if min(Arr[1:]) < v:
		count += 1
		ans.append(i + 1)
print(count)
print(*ans)


(n, v) = map(int, input().split())
l = []
for i in range(1, n + 1):
	a = list(map(int, input().split()))
	if min(a[1:]) < v:
		l.append(i)
print(len(l))
if len(l) != 0:
	print(' '.join(map(str, l)))


enteros = input()
(n, v) = enteros.split()
n = int(n)
v = int(v)
resultado = []
for i in range(1, n + 1):
	datos = input().split()
	datos = [int(x) for x in datos]
	for j in datos[1:]:
		if v > j:
			resultado.append(i)
			break
print(len(resultado))
print(' '.join((str(x) for x in sorted(resultado))))


nv = input().split(' ')
n = int(nv[0])
v = int(nv[1])
count = 0
ans = []
for i in range(n):
	istr = input().split(' ')
	rstr = istr[1:]
	dstr = []
	for j in rstr:
		dstr.append(int(j))
	mini = min(dstr)
	if mini < v:
		count = count + 1
		ans.append(str(i + 1))
print(count)
print(' '.join(ans))


(n, v) = input().split()
(n, v) = (int(n), int(v))
lis = []
for i in range(n):
	lis.append(input().split())
for i in range(n):
	for j in range(len(lis[i])):
		lis[i][j] = int(lis[i][j])
lis1 = []
for i in range(n):
	c = 0
	for j in range(1, len(lis[i])):
		if lis[i][j] < v:
			c = 1
	if c == 1:
		lis1.append(i + 1)
print(len(lis1))
if len(lis1) > 0:
	for e in lis1:
		print(e, end=' ')


(n, m) = map(int, input().split())
s = [i + 1 for i in range(n) if min(list(map(int, input().split()[1:]))) < m]
print(len(s))
print(*s)


(n, m) = map(int, input().strip().split()[:2])
z = set()
for x in range(n):
	l = list(map(int, input().strip().split()))
	for y in range(1, l[0] + 1):
		if l[y] < m:
			z.add(x + 1)
print(len(z))
z = list(z)
z.sort()
print(*z)


(n, v) = map(int, input().split())
L = [list(map(int, input().split())) for _ in range(n)]
R = []
for i in range(n):
	if min(L[i][1:]) < v:
		R += [i + 1]
print(len(R))
for i in range(len(R)):
	print(R[i], end=' ')


(sellers, money) = map(int, input().split())
data = []
for i in range(sellers):
	data.append([int(i) for i in input().split()])
ans = []
itr = 0
for array in data:
	if min(array[1:len(array)]) < money:
		ans.append(itr)
	itr += 1
print(len(ans))
for i in range(len(ans)):
	if i == len(ans) - 1:
		print(ans[i] + 1, end='')
	else:
		print(ans[i] + 1, end=' ')


(n, v) = [int(x) for x in input().split()]
ans = []
for i in range(n):
	x = min((int(x) for x in input().split()[1:]))
	if x < v:
		ans.append(str(i + 1))
print(len(ans))
print(' '.join(ans))


(traders, deposit) = list(map(int, input().split()))
number_of_traders = []
for trader_id in range(1, traders + 1):
	(_, *costs) = list(map(int, input().split()))
	if any([cost for cost in costs if deposit > cost]):
		number_of_traders.append(trader_id)
number_of_traders = set(number_of_traders)
number_of_traders = sorted(list(number_of_traders))
print(len(number_of_traders))
print(*number_of_traders)


def items():
	(n, v) = [int(i) for i in input().split()]
	ans = []
	for i in range(n):
		a = [int(i) for i in input().split()]
		a = a[1:]
		if min(a) < v:
			ans.append(str(i + 1))
	if len(ans) == 0:
		print('0')
	else:
		print(len(ans))
		print(' '.join(ans))
	return
items()


(n, v) = map(int, input().split())
l = []
for i in range(n):
	d = list(map(int, input().split()))
	if min(d[1:]) < v:
		l.append(i + 1)
print(len(l))
print(*l)


(n, v) = map(int, input().split())
l1 = []
count = 0
for i in range(n):
	l = list(map(int, input().split()))
	for j in range(1, l[0] + 1):
		if v > l[j]:
			count = count + 1
			l1.append(i + 1)
			break
print(count)
l1.sort()
for k in range(len(l1)):
	if len(l1) == 0:
		print('\t')
	else:
		print(l1[k], '', end='')


l = map(int, input().split())
(x, m) = l
ans = []
for i in range(1, x + 1):
	l = list(map(int, input().split()))
	l = sorted(l[1:])
	if l[0] < m:
		ans += [i]
if ans == []:
	print(0)
else:
	ans = list(map(str, sorted(ans)))
	print(len(ans))
	print(' '.join(ans))


(n, b) = map(int, input().split())
lia = []
for i in range(1, n + 1):
	lis = list(map(int, input().split()))
	for k in range(1, len(lis)):
		if b > lis[k]:
			lia.append(i)
			break
print(len(lia))
for i in lia:
	print(i, end=' ')


a = list(map(int, input().split()))
n = int(a[0])
v = int(a[1])
p = 0
k = 0
d = []
for i in range(n):
	c = 0
	b = []
	b = list(map(int, input().split()))
	k = int(b[0])
	l = [1] * (k + 1)
	for j in range(1, k + 1):
		l[j] = int(b[j])
	for m in range(1, k + 1):
		if l[m] < v:
			c = c + 1
	if c >= 1:
		p = p + 1
		d.append(i + 1)
print(p)
for i in range(len(d)):
	print(d[i], end=' ')


(n, d) = map(int, input().split(' '))
res = []
for i in range(n):
	mas = list(map(int, input().split(' ')))
	p = 0
	for j in range(1, len(mas)):
		if mas[j] < d:
			p = 1
	if p:
		res.append(str(i + 1))
print(len(res))
print(' '.join(res))


(n, m) = map(int, input().split(' '))
p = []
for i in range(n):
	l = input().split(' ')
	l = [int(x) for x in l]
	l1 = l[0]
	l2 = l[1:]
	for num in l2:
		if num < m:
			p.append(i)
			break
print(len(p))
for i in p:
	print(i + 1, end=' ')


(n, v) = map(int, input().split())
(c, s) = (0, [])
for x in range(n):
	i = list(map(int, input().split()))
	if v > min(i[1:]):
		c += 1
		s.append(x + 1)
print(c, ' '.join(map(str, sorted(s))), sep='\n')


(n, v) = [int(x) for x in input().split()]
res = []
for i in range(n):
	nums = [int(x) for x in input().split()][1:]
	m = min(nums)
	if m < v:
		res.append(str(i + 1))
print(len(res))
print(' '.join(res))


(nof, budget) = map(int, input().split())
s = [str(i + 1) for i in range(nof) if budget > min(list(map(int, input().split()))[1:])]
print(len(s))
print(' '.join(s))


(n, v) = map(int, input().split())
business_l = []
for i in range(1, n + 1):
	goods = list(map(int, input().split()))
	j = 1
	while j < len(goods) and goods[j] >= v:
		j += 1
	if j != len(goods):
		business_l.append(i)
print(len(business_l))
print(*business_l)


(n, v) = map(int, input().split())
li = []
q = 0
c = 0
for i in range(n):
	c += 1
	l = list(map(int, input().split()))
	if v > min(l[1:]):
		q += 1
		li.append(c)
		l.clear()
li.sort()
if len(li) == 0:
	print('0')
else:
	print(q)
	for i in li:
		print(i, end=' ')


(cases, money) = map(int, input().split())
ans = 0
sellers = []
for i in range(1, cases + 1):
	arr = list(map(int, input().split()))
	if min(arr[1:]) < money:
		ans += 1
		sellers.append(i)
print(ans)
print(*sellers)


(n, v) = [int(i) for i in input().split()]
c = 0
a = ''
for i in range(n):
	s = [int(i) for i in input().split()]
	if v > min(s[1:]):
		c += 1
		a += str(i + 1) + ' '
print(c)
print(a)


string = input()
numbers = string.split(' ')
n = int(numbers[0])
v = int(numbers[1])
prices = []
for x in range(n):
	string = input()
	numbers = string.split(' ')
	z = int(numbers[0])
	del numbers[0]
	for y in range(z):
		numbers[y] = int(numbers[y])
	prices.append(numbers)
sellers = []
for x in range(n):
	y = prices[x]
	if v > min(y):
		sellers.append(str(x + 1))
print(len(sellers))
print(' '.join(sellers))


(n, k) = list(map(int, input().split()))
ans = []
count = 0
for i in range(n):
	a = list(map(int, input().split()))
	if min(a[1:]) < k:
		count += 1
		ans.append(i + 1)
print(count)
if count > 0:
	sep = ' '
	print(sep.join(list(map(str, ans))))


(n, money) = [int(x) for x in input().split()]
count = 0
sellers = []
for i in range(n):
	val = [int(x) for x in input().split()]
	if min(val[1:]) < money:
		count += 1
		sellers.append(i + 1)
print(count)
sellers.sort()
print(' '.join([str(x) for x in sellers]))


sa = input().split(' ')
sellers = int(sa[0])
money = int(sa[1])
sa3 = []
c = 0
slist = []
for x in range(sellers):
	sa3 = []
	sa2 = input().split(' ')
	for element in sa2:
		sa3.append(int(element))
	sa3.remove(sa3[0])
	mini = min(sa3)
	if money > mini:
		c += 1
		slist.append(x + 1)
string = ''
for element in slist:
	string += str(element)
	string += ' '
print(c)
print(string.strip())


(n, k) = map(int, input().split())
ans = []
r = lambda : list(map(int, input().split()))
for x in range(n):
	(seller, *prices) = r()
	if any((i < k for i in prices)):
		ans.append(x + 1)
print(len(ans))
print(*ans)


(n, v) = map(int, input().split())
wins = set()
for i in range(n):
	s = list(map(int, input().split()))
	k = s[0]
	for j in range(1, k + 1):
		if s[j] < v:
			wins.add(i + 1)
			break
print(len(wins))
print(' '.join(map(str, sorted(wins))))


from sys import stdin, stdout
nv = list(map(int, stdin.readline().strip().split()))
n = nv[0]
v = nv[1]
seller_list = []
for i in range(1, n + 1):
	lst = list(map(int, stdin.readline().strip().split()))
	if min(lst[1:]) < v:
		seller_list.append(i)
seller_list.sort()
print_line = ''
for i in seller_list:
	print_line = print_line + str(i) + ' '
stdout.write(str(len(seller_list)) + '\n')
stdout.write(print_line)


(a, b) = map(int, input().split())
c = []
cnt = 0
for i in range(1, a + 1):
	l = list(map(int, input().split()))
	s = l[1:]
	x = sorted(s)
	if b > x[0]:
		c.append(str(i))
		cnt += 1
print(cnt)
print(' '.join(c))


(n, d) = input().split()
n = int(n)
d = int(d)
s = 0
t = ''
for i in range(n):
	h = list(map(int, input().split()))
	h = sorted(h)
	if h[1] < d:
		s += 1
		t += str(i + 1) + ' '
print(s)
if s != 0:
	print(t)


(jumlah, uang) = map(int, input().split())
lista = []
for z in range(1, jumlah + 1):
	x = list(map(int, input().split()))
	x.sort()
	if x[1] < uang:
		lista.append(z)
jumlah = len(lista)
print(jumlah)
if jumlah != 0:
	for zz in lista:
		print(zz, end=' ')


(n, v) = tuple(map(int, input().split()))
sellers = list()
for i in range(n):
	l = list(map(int, input().split()))
	k = l[0]
	s = l[1:]
	for sk in s:
		if sk < v:
			sellers.append(i + 1)
			break
print(len(sellers))
print(' '.join(map(str, sellers)))


gi = lambda : list(map(int, input().strip().split()))
(n, m) = gi()
ans = []
for k in range(n):
	l = gi()[1:]
	l.sort()
	if l[0] < m:
		ans.append(k + 1)
print(len(ans))
print(' '.join(map(str, ans)))


r = lambda : list(map(int, input().split()))[1:]
(n, c) = map(int, input().split())
d = []
for _ in range(n):
	for i in r():
		if i < c:
			d.append(str(_ + 1))
			break
print(len(d))
print(' '.join(d))


def valera_antique(v, dict1):
	sellers = []
	for i in dict1.keys():
		for j in dict1[i]:
			if j < v and i not in sellers:
				sellers.append(i)
	sellers = sorted(sellers)
	print(len(sellers))
	a = ''
	for i in range(len(sellers)):
		a = a + str(sellers[i]) + ' '
	print(a)
(n, v) = input().split()
dict1 = dict()
for i in range(int(n)):
	array = [int(x) for x in input().split()]
	dict1[i + 1] = array[1:len(array)]
valera_antique(int(v), dict1)


a = list((int(x) for x in input().split()))
l = []
for i in range(a[0]):
	b = list((int(x) for x in input().split()))
	for j in b:
		if j > 1000 and j < a[1]:
			l.append(i + 1)
			break
print(len(l))
for i in l:
	print(i, end=' ')


(n, m) = map(int, input().split())
b = []
for temp in range(n):
	a = list(map(int, input().split()))
	y = 1
	while y < len(a):
		if m > a[y]:
			b.append(temp + 1)
			break
		y += 1
print(len(b))
print(*b)


reg = input().split()
n = int(reg[0])
coins = int(reg[1])
counter = 0
count = 0
result = ''
for i in range(0, n):
	re = input().split()
	for j in range(1, len(re)):
		counter = 0
		if int(re[j]) < coins:
			counter += 1
		if counter == 1:
			result += str(i + 1) + ' '
			count += 1
			break
print(count)
print(result)


list1 = []
x = [int(item) for item in input().split()]
for item in range(x[0]):
	y = [int(item) for item in input().split()]
	z = y[0]
	y.remove(z)
	for items in y:
		if x[1] > items:
			list1.append(item + 1)
list1 = list(set(list1))
list1.sort()
anslist = [str(item) for item in list1]
if len(anslist) == 0:
	print(0)
else:
	print(len(anslist))
	print(' '.join(anslist))


def inpNum():
	return int(input())

def inpNums():
	return map(int, input().split())

def inpList():
	return list(map(int, input().split()))

def inpMatrix(rows):
	return [list(map(int, input().split())) for _ in range(rows)]
(n, v) = inpNums()
s = []
m = inpMatrix(n)
for i in range(n):
	for j in m[i][1:]:
		if j < v:
			s.append(i + 1)
			break
print(len(s))
print(*s)


(n, v) = map(int, input().split())
s = [sorted(map(int, input().split()))[1:] for i in range(n)]
p = []
for i in range(n):
	if s[i][0] < v:
		p += [i + 1]
print(len(p))
print(' '.join(map(str, p)))


(num_sellers, money) = list(map(int, input().split()))
seller_antiques = list()
for idx in range(num_sellers):
	seller_antiques.append(list(map(int, input().split()))[1:])
deals = list()
for idx in range(num_sellers):
	seller_antiques[idx].sort()
	if money > seller_antiques[idx][0]:
		deals.append(idx + 1)
deals_len = len(deals)
print(deals_len)
if deals_len > 0:
	print(' '.join(list(map(str, deals))))


(num, limit) = list(map(int, input().split()))
l = []
for i in range(num):
	li = list(map(int, input().split()))
	if limit > min(li[1:]):
		l.append(i + 1)
print(len(l))
print(' '.join(map(str, l)))


(n, v) = (int(i) for i in input().split())
results = []
for i in range(n):
	data = [int(j) for j in input().split()]
	if min(data[1:]) < v:
		results.append(i + 1)
print(len(results))
if len(results) > 0:
	print(' '.join((str(s) for s in results)))


(a, b) = map(int, input().split())
z = 0
v = []
for j in range(a):
	(n, *m) = map(int, input().split())
	for i in m:
		if b - i > 0:
			z += 1
			v.append(j + 1)
			break
v.sort()
print(z)
print(*v)


from sys import stdin, stdout
input = stdin.readline
(n, v) = map(int, input().split())
u = [list(map(int, input().split())) for i in range(n)]
ans = 0
col = ''
for i in range(n):
	for j in range(1, u[i][0] + 1):
		if u[i][j] < v:
			ans += 1
			if col != '':
				col += ' '
			col += str(i + 1)
			break
stdout.write(str(ans) + '\n')
stdout.write(col)


def check(g):
	for x in g:
		if x < 0:
			return True
	else:
		return False

def applyall(d):
	k = []
	global v
	for x in d:
		y = x - v
		k.append(y)
	return k
[n, v] = [int(x) for x in input().split(' ')]
l = []
for i in range(n):
	temp = [int(x) for x in input().split(' ')]
	l.append(temp)
counter = 0
dealers = []
for i in range(len(l)):
	temp = applyall(l[i][1:])
	if check(temp):
		dealers.append(i + 1)
print(len(dealers))
for x in dealers:
	print(x, end=' ')


(n, v) = map(int, input().split())
res = []
for i in range(1, n + 1):
	li = list(map(int, input().split()))
	if min(li[1:]) < v:
		res.append(i)
res.sort()
if len(res) == 0:
	print(0)
else:
	print(len(res))
	print(' '.join(map(str, res)))


(n, s) = [int(x) for x in input().split()]
arr = []
for i in range(n):
	(x, *l) = input().split()
	for j in range(int(x)):
		if int(l[j]) < s:
			arr.append(i)
			break
print(len(arr))
for i in range(len(arr)):
	arr[i] += 1
print(*arr)


(n, t) = map(int, input().split())
count = 0
posb = []
for i in range(n):
	s = list(map(int, input().split()))
	for j in range(1, len(s)):
		if t > s[j] and i + 1 not in posb:
			count += 1
			posb.append(i + 1)
posb.sort()
print(count)
for i in posb:
	print(i, end=' ')


a = (int(x) for x in input().split())
p = next(a)
v = next(a)
res = []
for i in range(1, p + 1):
	if len([x for x in (int(a) for a in input().split()[1:]) if x < v]) >= 1:
		res.append(str(i))
print(len(res), '\n', ' '.join(res))


(n, v) = map(int, input().split())
m = []
for i in range(n):
	l = list(map(int, input().split()))
	l = l[1:]
	for j in l:
		if j < v:
			m.append(i + 1)
			break
m.sort()
print(len(m))
print(' '.join((str(x) for x in m)))


(n, v) = map(int, input().split())
a = []
k = 0
for _ in range(n):
	x = list(map(int, input().rstrip().split()))
	for i in range(1, len(x)):
		if x[i] < v:
			a.append(_ + 1)
			break
print(len(a))
if len(a) > 0:
	for _ in range(len(a)):
		print(a[_], end=' ')


(n, v) = map(int, input().split())
p = 0
count = []
for i in range(1, n + 1):
	seller = list(map(int, input().split()))
	(k, prices) = (seller[0], seller[1:])
	for price in prices:
		if v > price:
			p += 1
			count.append(i)
			break
print(p)
if p > 0:
	print(' '.join(map(str, count)))


(n, v) = map(int, input().split())
total = 0
list1 = []
for i in range(n):
	a = list(map(int, input().split()))
	a.pop(0)
	a.sort()
	if v > a[0]:
		total += 1
		list1.append(i + 1)
print(total)
for i in range(len(list1)):
	print(list1[i], end=' ')


(n, v) = map(int, input().split())
counter = 0
x = ''
for i in range(n):
	l = list(map(int, input().split()))
	for j in range(1, len(l)):
		if l[j] < v:
			x += str(i + 1)
			x += ' '
			counter += 1
			break
if counter == 0:
	print(0)
else:
	print(counter)
	print(x[:-1])


(n, v) = map(int, input().strip().split())
c = []
for i in range(n):
	arr = list(map(int, input().strip().split()))
	if v > min(arr[1:]):
		c.append(i + 1)
print(len(c))
print(*c)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
(N, K) = map(int, input().split())
ans = []
for i in range(N):
	a = [int(x) for x in input().split()]
	if any((K > v for v in a[1:])):
		ans.append(i + 1)
print(len(ans))
if ans:
	print(' '.join(map(str, ans)))


import sys

def data():
	return sys.stdin.readline().strip()

def sp():
	return map(int, data().split())

def l():
	return list(sp())
buyer = l()
sellers = buyer[0]
pool = buyer[1]
res = []
for i in range(sellers):
	res.append(l())
total = 0
buyied = []
for (i, items) in enumerate(res):
	for item in items[1:]:
		if item < pool:
			total += 1
			buyied.append(i + 1)
buyied = list(set(buyied))
print(len(buyied))
for i in sorted(buyied):
	print(i, end=' ')


def solve(k, s):
	res = []
	l = []
	for (idx, items) in enumerate(s):
		items = sorted(items)
		l.append((idx + 1, items[0]))
	for (i, seller) in enumerate(l):
		if k > seller[1]:
			res.append(seller[0])
	return sorted(res)
(n, k) = map(int, input().split())
s = []
for _ in range(n):
	l = [int(x) for x in input().split()]
	s.append(l[1:])
res = solve(k, s)
print(len(res))
for i in res:
	print(i, end=' ')


I = lambda : map(int, input().split())
(n, v) = I()
l = []
for i in range(n):
	(k, *s) = I()
	s.sort()
	if v > s[0]:
		l.append(i + 1)
print(len(l), '\n', *l)


(n, v) = map(int, input().split())
y = []
for i in range(1, n + 1):
	x = [int(x) for x in input().split()]
	x.sort()
	if x[1] < v:
		y.append(i)
print(len(y))
print(*y)


(n, v) = list(map(int, input().split(' ')))
s = 0
sellers = []
for i in range(n):
	m = min(list(map(int, input().split(' ')))[1:])
	if v > m:
		s += 1
		sellers.append(str(i + 1))
print(s)
print(' '.join(sellers))


(n, v) = map(int, input().split())
buys = []
for i in range(n):
	(k, *prices) = map(int, input().split())
	for p in prices:
		if p < v:
			buys.append(i + 1)
			break
print(len(buys))
if buys:
	print(*buys, sep=' ')


(n, v) = map(int, input().split(sep=' '))
l = []
for i in range(n):
	k = input().split(sep=' ')
	a = int(k[0])
	l.append(k[1:a + 1])
m = []
for i in l:
	for j in i:
		if int(j) < v:
			m.append(l.index(i) + 1)
			break
if m.__len__() == 0:
	print(0)
else:
	print(m.__len__())
	for i in m:
		print(i, end=' ')


(n, m) = map(int, input().split())
l_s = list()
t = 0
for i in range(n):
	l_i = list(map(int, input().split()))
	for p in l_i[1:]:
		if m > p:
			t += 1
			l_s.append(str(i + 1))
			break
print(t)
print(' '.join(l_s))


from sys import stdin

def solve(n, v, k):
	result = []
	for i in range(0, len(k)):
		if v > min(k[i]):
			result.append(i + 1)
	return result

def __starting_point():
	s = stdin.readline().split(' ')
	n = int(s[0])
	v = int(s[1])
	k = []
	for i in range(0, n):
		sn = stdin.readline().split(' ')[1:]
		ki = [int(kij) for kij in sn]
		k.append(ki)
	solution = solve(n, v, k)
	l = len(solution)
	print(l)
	if l > 0:
		print(' '.join([str(x) for x in solution]))
__starting_point()


(n, v) = map(int, input().split())
tmp = []
for i in range(n):
	a = input().split()
	for j in a[1:]:
		if v > int(j):
			tmp.append(i + 1)
			break
if len(tmp) > 0:
	print(str(len(tmp)) + ' ' + str(tmp)[1:-1].replace(',', '').replace("'", ''))
else:
	print('0')


import bisect
from itertools import accumulate
import os
import sys
import math
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
(n, v) = map(int, input().split())
ans = []
for i in range(n):
	a = list(map(int, input().split()))
	a = a[0:]
	a.sort()
	for j in range(1, len(a)):
		if a[j] < v:
			ans.append(i + 1)
			break
print(len(ans))
print(*ans)


(n, v) = map(int, input().split())
s = 0
l = []
for i in range(n):
	temp = list(map(int, input().split()))
	if min(temp[1:]) < v:
		s += 1
		l.append(i + 1)
print(s)
print(' '.join((str(e) for e in l)))


(n, k) = map(int, input().split())
list2 = []
for i in range(1, n + 1):
	list1 = list(map(int, input().split()))
	m = list1[0]
	list1 = list1[1:]
	s = min(list1)
	if s < k:
		list2.append(i)
list2.sort()
print(len(list2))
print(*list2)


import itertools as ittls
from collections import Counter

def inputarray(func=int):
	return map(func, input().split())

def glen(s):
	return sum((1 for _ in s))
(N, v) = map(int, input().split())
res = []
for i in range(N):
	A = map(lambda x: int(x) < v, input().split())
	B = Counter(ittls.islice(A, 1, None))
	if True in B:
		res.append(i)
print(len(res))
ans = ''
for i in res:
	ans = ans + str(i + 1) + ' '
print(ans)


(n, v) = map(int, input().split())
s = 0
l = []
for i in range(n):
	a = [int(k) for k in input().split()]
	for j in range(1, len(a)):
		if v > a[j]:
			s += 1
			l.append(i + 1)
			break
print(s)
for i in l:
	print(i, end=' ')


(a, b) = map(int, input().split())
cnt = 0
l = []
for i in range(a):
	x = [int(x) for x in input().split()]
	x.sort()
	if x[1] < b:
		cnt += 1
		l.append(i + 1)
print(cnt)
l.sort()
for j in l:
	print(j, end=' ')


(n, v) = list(map(int, input().split()))
c = 0
b = []
for i in range(n):
	s = list(map(int, input().split()))
	k = s[0]
	s = s[1:]
	for j in range(len(s)):
		if s[j] < v:
			c += 1
			b.append(i + 1)
			break
if c == 0:
	print(0)
else:
	print(c)
	print(*b)


(a, b) = map(int, input().split())
t = 0
k = []
for i in range(a):
	t += 1
	lis = list(map(int, input().split()))
	lis = lis[1:]
	lis.sort()
	for i in range(len(lis)):
		if lis[i] < b:
			k.append(t)
k = list(set(k))
k.sort()
print(len(k))
for i in range(len(k)):
	print(k[i], end=' ')


(n, k) = map(int, input().split())
an = []
for i in range(n):
	A = list(map(int, input().split()))
	if min(A[1:]) < k:
		an += [i + 1]
an.sort()
print(len(an))
for i in an:
	print(i, end=' ')


(x, y) = [int(a) for a in input().split()]
p = []
o = 0
for i in range(1, x + 1):
	z = [int(a) for a in input().split()]
	a = z.pop(0)
	for j in z:
		if j < y:
			p.append(i)
			break
print(len(p))
for i in p:
	print(i, end=' ')


from math import *
(n, v) = map(int, input().split())
l = list()
k = 0
index = list()
for i in range(0, n):
	l.append(list())
	s = input()
	s = s[2:len(s)]
	l[i] = s.split()
	l[i] = sorted(list(map(lambda x: int(x), l[i])))
	if l[i][0] < v:
		index.append(i + 1)
		k += 1
print(k)
if k > 0:
	print(*index)


a = []
a = input().split()
n = int(a[0])
v = int(a[1])
s = []
for i in range(0, n):
	s.append([int(j) for j in input().split()])
k = []
for i in range(0, n):
	k.append(s[i][0])
	temp = s[i][0]
	del s[i][0]
d = []
for i in range(0, n):
	flag = 0
	for j in range(0, k[i]):
		if s[i][j] < v:
			flag = 1
	if flag == 1:
		d.append(i + 1)
d.sort()
print(len(d))
for i in range(0, len(d)):
	print(d[i], end=' ')


(k, m) = map(int, input().split())
li = []
for i in range(k):
	li.append([int(i) for i in input().split()][1:])
r = set()
for i in range(k):
	for j in li[i]:
		if m > j:
			r.add(i + 1)
print(len(r))
print(*r)


(n, v) = map(int, input().split())
cnt = 0
fi = []
for i in range(n):
	b = list(map(int, input().split()))
	if min(b[1:]) < v:
		fi.append(i + 1)
print(len(fi))
fi.sort()
print(*fi)


(n, v) = list(map(int, input().split()))
ans = []
for i in range(n):
	arr = list(map(int, input().split()))
	arr.sort()
	if v > arr[1]:
		ans.append(i + 1)
print(len(ans))
for i in ans:
	print(i, end=' ')


(d, b) = list(map(int, input().split()))
n = []
for e in range(d):
	l = list(map(int, input().split()))
	i = l[1:]
	i.sort()
	if b > i[0]:
		n.append(str(e + 1))
print(len(n))
if len(n) > 0:
	print(' '.join(n))


def main():
	(n, v) = map(int, input().split())
	c = []
	for i in range(n):
		f = 0
		x = list(map(int, input().split()))
		x.sort()
		if x[1] < v:
			c.append(i + 1)
	print(len(c))
	if len(c) > 0:
		for i in range(len(c)):
			print(c[i], end=' ')
main()


(n, m) = map(int, input().split())
c = 0
z = []
for i in range(n):
	l = list(map(int, input().split()))
	y = l[0]
	l.pop(0)
	r = min(l)
	if r < m:
		c += 1
		z.append(i + 1)
print(c)
print(*z)


(n, v) = map(int, input().split())
otvet = ''
for i in range(n):
	l = list(map(int, input().split()))
	l = sorted(l)
	for j in range(1, l[0] + 1):
		if l[j] < v:
			otvet = otvet + str(i + 1) + ' '
		break
print(len(otvet.split()))
print(otvet)


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
(nb_sellers, has_now) = read_ints()
valids = []
for i in range(nb_sellers):
	prices = read_ints()[1:]
	if min(prices) < has_now:
		valids.append(i + 1)
if len(valids) == 0:
	print(0)
else:
	print(len(valids))
	print(*valids)


(n, v) = map(int, input().split())
d = []
for i in range(n):
	b = list(map(int, input().split()))
	flag = 0
	for j in range(1, len(b)):
		if b[j] < v:
			flag = 1
	if flag == 1:
		d.append(i + 1)
print(len(d))
print(*d)


(n, m) = map(int, input().split())
ans = []
count = 0
for i in range(n):
	l = list(map(int, input().split()))
	sno = l[0]
	l = l[1:]
	l.sort()
	if l[0] < m:
		count += 1
		ans.append(i + 1)
print(count)
if count > 0:
	print(*ans)


(n, v) = list(map(int, input().strip().split(' ')))
sellers = list()
for i in range(0, n):
	items = list(map(int, input().strip().split(' ')))[1:]
	for item in items:
		if item < v:
			sellers.append(i + 1)
			break
number_sellers = len(sellers)
print(number_sellers)
if number_sellers > 0:
	print(*sellers, sep=' ')


val = [int(n) for n in input().split()]
n = val[0]
s = val[1]
selectedVendors = []
for i in range(n):
	vendor = [int(n) for n in input().split()]
	items = vendor[0]
	for j in range(1, items + 1):
		if vendor[j] < s:
			selectedVendors.append(i + 1)
			break
print(len(selectedVendors))
rawSelectedVendors = ''
for vendor in selectedVendors:
	rawSelectedVendors += str(vendor) + ' '
print(rawSelectedVendors)


(n, v) = [int(c) for c in input().split()]
res = []
for i in range(n):
	lots = [int(c) for c in input().split()]
	for j in range(1, len(lots)):
		if lots[j] < v:
			res.append(i + 1)
			break
print(len(res))
if len(res) > 0:
	print(' '.join(map(str, res)))


(n, v) = map(int, input().split())
sellers = []
count = 0
for j in range(n):
	l = [int(x) for x in input().split()]
	for i in range(1, l[0] + 1):
		if v > l[i]:
			sellers.append(j + 1)
			count += 1
			break
print(count)
for x in sellers:
	print(x, end=' ')


(n, v) = map(int, input().split())
sellers = []
indx = 0
for i in range(n):
	indx += 1
	items = list(map(int, input().split()))
	items.pop(0)
	for i in items:
		if i < v:
			sellers.append(indx)
			break
print(len(sellers))
if len(sellers) != 0:
	for i in sellers:
		print(i, end=' ')


(n, v) = [int(i) for i in input().split()]
s = []
for i in range(n):
	s.append([min([int(i) for i in input().split()][1:]), i])
a = []
s.sort()
for i in range(len(s)):
	if v > s[i][0]:
		a.append(s[i][1])
print(len(a))
a.sort()
print(' '.join([str(i + 1) for i in a]))


(n, v) = map(int, input().split(' '))
a = list()
for i in range(0, n):
	l = list(map(int, input().split(' ')))
	b = l[1:]
	b.sort()
	if b[0] < v:
		a.append(i + 1)
a.sort()
print(len(a))
if len(a) > 0:
	print(*a)


(n, v) = [int(x) for x in input().split()]
seller = []
for i in range(0, n):
	items = [int(x) for x in input().split()]
	items.pop(0)
	minValue = min(items)
	if minValue < v:
		seller.append(i + 1)
print(len(seller))
for x in seller:
	print(x, end=' ')


(n, v) = list(map(int, input().split(' ')))
a = []
for i in range(n):
	x = list(map(int, input().split(' ')))
	for j in range(1, x[0] + 1):
		if x[j] < v:
			a.append(i + 1)
			break
print(len(a))
print(*a)


(n, v) = map(int, input().split())
store = []
for k in range(n):
	for x in list(map(int, input().split()))[1:]:
		if v > x:
			store.append(k + 1)
store = sorted(list(set(store)))
print(len(store))
print(*store)


(n, m) = map(int, input().split())
c = 0
p = []
for i in range(1, n + 1):
	l = list(map(int, input().split()))
	l = sorted(l)
	if l[1] < m:
		p.append(i)
print(len(p))
print(*p)


(n, v) = input().split()
n = int(n)
v = int(v)
sellers = []
prices = []
if n >= 1 and n <= 50:
	if v >= 10 ** 4 and v <= 10 ** 6:
		for i in range(1, n + 1):
			prices = input().split()
			k = int(prices.pop(0))
			if k == len(prices):
				for j in range(k):
					p = int(prices[j])
					if p < v:
						sellers.append(i)
						break
print(len(sellers))
for q in sellers:
	print(q, end=' ')


(n, k) = map(int, input().split())
r = []
for i in range(n):
	(m, *ls) = list(map(int, input().split()))
	for l in ls:
		if l < k:
			r.append(i + 1)
			break
print(len(r))
print(' '.join(map(str, r)))


(n, v) = map(int, input().split())
cont = 0
res = []
for i in range(n):
	items = list(map(int, input().split()))
	ni = items.pop(0)
	for j in range(ni):
		if items[j] < v:
			cont += 1
			res.append(i + 1)
			break
print(cont)
print(' '.join(map(str, res)))


I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
(a, b) = M()
d = []
for i in range(a):
	l = LI()
	l = l[1:]
	l.sort()
	if l[0] < b:
		d += [i + 1]
print(len(d))
print(*d)


x = input().split(' ')
sellers = int(x[0])
money = int(x[1])
allSellers = []
req = []
output = ''
count = 0
sellersC = 1
for x in range(sellers):
	allSellers.append(input().split(' '))
for y in allSellers:
	store = int(y.pop(0))
	for z in range(len(y)):
		y[z] = int(y[z])
	if min(y) < money:
		req.append(sellersC)
		count += 1
	sellersC += 1
if len(req) == 0:
	print(count)
else:
	req.sort()
	print(count)
	print(*req, sep=' ')


a = list(map(int, input().split()))
(n, v) = (a[0], a[1])
b = []
for i in range(n):
	c = list(map(int, input().split()))
	b.append(c)
for i in range(n):
	b[i] = sorted(b[i])
count = 0
r = ''
for i in range(n):
	if v > b[i][1]:
		count += 1
		r = r + str(i + 1) + ' '
print(count)
print(r)


(lambda t, mon: (lambda f: [print(len(f)), print(*f)])(sorted([i + 1 for i in range(t) if mon - min(list(map(int, input().split()))[1:]) > 0])))(*list(map(int, input().split())))


(n, v) = list(map(int, input().rstrip().split()))
l = []
for i in range(n):
	if len([x for x in list(map(int, input().split()))[1:] if x < v]) > 0:
		l.append(i + 1)
print(len(l))
for i in l:
	print(i, end=' ')


(n, v) = map(int, input().split())
x = []
c = 0
for u in range(n):
	l = list(map(int, input().split()))
	a = l[0]
	l = l[1:]
	m = min(l)
	if m < v:
		x.append(u + 1)
		c = c + 1
if c == 0:
	print(0)
else:
	print(c)
	print(*x)


[n, v] = list(map(int, input().split(' ')))
result = []
for i in range(n):
	t = list(map(int, input().split(' ')))
	t.pop(0)
	if min(t) < v:
		result.append(i + 1)
print(len(result))
print(*result)


(n, v) = map(int, input().split())
sellers = []
for i in range(n):
	x = list(map(int, input().split()))
	for j in range(x[0]):
		if x[j + 1] < v:
			sellers.append(i)
			break
print(len(sellers))
for i in sellers:
	print(str(i + 1), end=' ')


(n, v) = [int(x) for x in input().split()]
q = []
for i in range(n):
	q.append([int(x) for x in input().split()][1:])
ans = []
for i in range(n):
	temp = q[i]
	if any((y < v for y in temp)):
		ans.append(i + 1)
print(len(ans))
print(' '.join(map(str, ans)))


s = input().split()
n = int(s[0])
v_money = int(s[1])
list = []
for i in range(n):
	line = input().split()
	status = False
	for l in range(len(line) - 1):
		if v_money > int(line[l + 1]):
			status = True
	if status:
		list.append(i + 1)
if not list:
	print(0)
else:
	print(len(list))
	for i in list:
		print(i, end=' ')


(n, v) = map(int, input().split())
sellers = [list(map(int, input().split())) for i in range(n)]
(res_amount, res_sellers) = (0, [])
for (i, p) in enumerate(sellers):
	if min(p[1:]) < v:
		res_amount += 1
		res_sellers.append(i + 1)
print(res_amount)
print(*res_sellers)


(n, m) = map(int, input().split())
s = set()
for x in range(n):
	l = [int(v) for v in input().split()]
	for i in l[1:]:
		if m > i:
			s.add(x + 1)
l1 = sorted(list(s))
if len(l1) >= 1:
	print(len(l1))
	for i in l1:
		print(i, end=' ')
else:
	print(0)


(n, v) = map(int, input().split())
lst = []
for i in range(n):
	s = sorted(list(map(int, input().split())))[1:]
	if s[0] < v:
		lst.append(i + 1)
print(len(lst))
if len(lst) > 0:
	print(*lst, sep=' ')


firstLine = [int(x) for x in input().split()]
sellers = firstLine[0]
money = firstLine[1]
deals = ''
dealCount = 0
for i in range(1, sellers + 1):
	temp = [int(x) for x in input().split()]
	for j in range(1, len(temp)):
		if temp[j] < money:
			dealCount += 1
			deals += str(i) + ' '
			break
print(dealCount)
print(deals)


(a, b) = map(int, input().split())
l = []
z = 0
for i in [0] * a:
	d = sorted(map(int, input().split()))[1:]
	z += 1
	if b > d[0]:
		l.append(z)
print(len(l), '\n', *sorted(l))


(n, v) = map(int, input().split())
kol = 0
saller = []
for i in range(n):
	mas = list(map(int, input().split()))
	for j in mas[1:]:
		if v > j:
			saller.append(i + 1)
			kol += 1
			break
print(kol)
for i in saller:
	print(i, end=' ')


from sys import stdin

def main():
	inp = stdin
	(n, v) = list(map(int, inp.readline().strip().split()))
	dicti = dict()
	sellers = list()
	for i in range(1, n + 1):
		a = str(i)
		Items = [int(x) for x in inp.readline().strip().split()]
		dicti[a] = Items
	for i in range(1, n + 1):
		flag = False
		for j in range(1, len(dicti[str(i)])):
			if dicti[str(i)][j] < v and flag == False:
				sellers.append(str(i))
				flag = True
	print(len(sellers))
	print(' '.join(sellers))
main()


(n, v) = map(int, input().split())
k = [str(i + 1) for i in range(n) if [x for x in list(map(int, input().split()))[1:] if x < v]]
print(len(k))
print(' '.join(k))


line = [int(i) for i in str(input()).split()]
sellers = []
for i in range(line[0]):
	linei = [int(i) for i in str(input()).split()[1:] if line[1] > int(i)]
	if len(linei) > 0:
		sellers.append(i + 1)
print(len(sellers))
print(' '.join([str(i) for i in sellers]))


(x, amount) = map(int, input().strip().split())
l = []
for i in range(x):
	l.append(list(map(int, input().strip().split())))
items = []
for i in l:
	items.append(i.pop(0))
business = []
for i in range(x):
	for k in range(items[0]):
		if l[i][k] < amount and business.count(i + 1) == 0:
			business.append(i + 1)
	items.pop(0)
if len(business) == 0:
	print(len(business))
else:
	print(len(business))
	print(''.join((str(v) + ' ' for v in business)))


(n, m) = map(int, input().split())
s = []
ans = 0
for j in range(n):
	(a, *b) = list(map(int, input().split()))
	for i in b:
		if i < m:
			ans += 1
			s.append(j + 1)
			break
s.sort()
print(ans)
print(*s)


(m, sum) = map(int, input().split())
output = []
for i in range(m):
	if min(tuple(map(int, input().split()))[1:]) < sum:
		output.append(i + 1)
if len(output) > 0:
	print(len(output))
	print(*output)
else:
	print(0)


(t, mon) = map(int, input().split())
mass = sorted([[i + 1, min(list(map(int, input().split()))[1:])] for i in range(t)], key=lambda x: x[1], reverse=True)
done = []
while mass:
	if mon - mass[-1][1] > 0:
		done.append(mass[-1][0])
	mass.pop()
print(len(done))
print(*sorted(done))


(n, v) = map(int, input().split())
l1 = []
for i in range(n):
	l = list(map(int, input().split()))
	for j in l[1:]:
		if j < v:
			if i + 1 not in l1:
				l1.append(i + 1)
print(len(l1))
print(*l1)


(n, v) = map(int, input().split())
l = []
for cont in range(0, n):
	l.append(list(map(int, input().split()))[1:])
ris = []
for cont in range(0, len(l)):
	for pr in l[cont]:
		if v > pr:
			ris.append(str(cont + 1))
			break
print(len(ris))
print(' '.join(ris))


(v, m) = map(int, input().split())
ans = []
for i in range(v):
	aa = sorted(list(map(int, input().split()))[1:])
	if aa[0] < m:
		ans.append(i + 1)
print(len(ans))
print(*ans)


def main():
	(n, v) = map(int, input().split())
	res = []
	for i in range(n):
		costs = [int(i) for i in input().split()][1:]
		costs.sort()
		if costs[0] < v:
			res.append(i + 1)
	print(len(res))
	print(*res)
main()


(n, v) = list(map(int, input().split()))
sellers = []
for i in range(n):
	auctions = list(map(int, input().split()))
	k = auctions[0]
	for j in range(k):
		if v > auctions[1 + j]:
			sellers.append(str(i + 1))
			break
print(len(sellers))
print(' '.join(sellers))


import sys
(n, v) = [int(i) for i in input().split(' ')]
summa = 0
s = ''
for i in range(n):
	a = [int(i) for i in input().split(' ')]
	if min(a[1:]) < v:
		summa += 1
		if s == '':
			s = str(i + 1)
		else:
			s = s + ' ' + str(i + 1)
print(summa)
print(s)


def main():
	s = input()
	s = s.split()
	n = int(s[0])
	v = int(s[1])
	arr = []
	aa = 1
	while n:
		s = input()
		s = s.split()
		x = int(s[0])
		c = 1
		while c < len(s):
			if int(s[c]) < v:
				arr.append(aa)
				break
			c += 1
		n -= 1
		aa += 1
	print(len(arr))
	s = ''
	for i in arr:
		s += str(i)
		s += ' '
	print(s)
main()


(n, m) = map(int, input().split())
ans = []
idx = 0
for _ in range(n):
	x = list(map(int, input().split()))
	for i in range(x[0]):
		if x[i + 1] < m:
			idx += 1
			ans.append(_ + 1)
			break
print(idx)
print(*sorted(ans), sep=' ')


(n, s) = map(int, input().split())
S = []
k = 0
for i in range(n):
	l = list(map(int, input().split()))
	for j in range(1, l[0] + 1):
		if l[j] < s:
			k = k + 1
			S.append(str(i + 1))
			break
print(k)
print(' '.join(S))


(n, p_) = map(int, input().split())
array = []
for i in range(n):
	array.append(list(map(int, input().split())))
c = 0
a = []
for j in range(n):
	for k in range(array[j][0]):
		if p_ > array[j][k + 1]:
			c += 1
			a.append(j + 1)
			break
print(c)
for l in range(1, c + 1):
	print(a[l - 1], end=' ')


mod = 1000000007
ssi = lambda : map(int, input().split())
(n, v) = ssi()
a = []
for _ in range(n):
	s = list(ssi())
	k = s[0]
	s = s[1:]
	s.sort()
	if s[0] < v:
		a.append(_ + 1)
print(len(a))
for _ in range(len(a)):
	print(a[_], end=' ')


(a, b) = map(int, input().split())
L1 = []
for k in range(a):
	L = list(map(int, input().split()))
	m = min(L[1:])
	if b > m:
		L1 += [str(k + 1)]
print(len(L1))
print(' '.join(L1))


(n, v) = [int(x) for x in input().split()]
a = [[int(x) for x in input().split()] for j in range(n)]
temp = []
count = 0
for i in range(n):
	for j in range(1, a[i][0] + 1):
		if a[i][j] < v:
			count += 1
			temp.append(i + 1)
			break
if temp == []:
	print(0)
else:
	print(count)
	for values in temp:
		print(values, end=' ')


(n, k) = map(int, input().split())
res = []
s = 1
for i in range(n):
	li = list(map(int, input().split()))
	for j in range(1, len(li)):
		if k > li[j]:
			res.append(s)
			break
	s += 1
print(len(res))
if len(res) > 0:
	res.sort()
	print(*res)


(n, v) = [int(i) for i in input().split()]
yes = []
for i in range(n):
	l = [int(i) for i in input().split()]
	for j in l[1:]:
		if v > j:
			yes += [i + 1]
			break
print(len(yes))
for i in yes:
	print(i, end=' ')


input_arg = [int(i) for i in input().split()]
(sellers_num, money) = (input_arg[0], input_arg[1])
sellers = []
for i in range(sellers_num):
	sellers.append([int(i) for i in input().split()[1:]])
(ans, ans_sellers) = (0, '')
for i in range(sellers_num):
	for j in range(len(sellers[i])):
		if money > sellers[i][j]:
			ans += 1
			ans_sellers += str(i + 1) + ' '
			break
print(ans)
print(ans_sellers[:-1])


from sys import stdin, stdout
(n, v) = map(int, input().split())
arr = []
ar = []
count = 0
for __ in range(n):
	arr.append(list(map(int, input().split())))
for i in range(n):
	for j in range(1, arr[i][0] + 1):
		if v > arr[i][j]:
			count += 1
			ar.append(i + 1)
			break
print(count)
for i in range(len(ar)):
	stdout.write(str(ar[i]) + ' ')


(n, m) = map(int, input().split())
a = []
for j in range(n):
	c = list(map(int, input().split()))
	for i in range(c[0]):
		if c[i + 1] < m:
			a.append(j + 1)
			break
print(len(a))
print(*a)


(x, y) = map(int, input().split())
p = []
k = 0
for i in range(x):
	t = list(map(int, input().split()))
	t = min(t[1:])
	if y > t:
		k += 1
		p.append(i + 1)
print(k)
print(*p)


(n, v) = list(map(int, input().split()))
l = []
for x in range(n):
	l.append(list(map(int, input().split())))
s = []
for x in l:
	if min(x[1:]) < v:
		s.append(l.index(x) + 1)
print(len(s))
for x in s:
	print(x, end=' ')


(n, m) = map(int, input().split())
d = []
ds = 0
for i in range(n):
	L = list(map(int, input().split()))
	del L[0]
	if m > min(L):
		ds += 1
		d += [i + 1]
print(ds)
if len(d) == 0:
	print()
else:
	for i in d[:-1]:
		print(i, end=' ')
	print(d[-1])


(n, m) = map(int, input().split())
l = []
for i in range(n):
	x = list(map(int, input().rstrip().rsplit()))
	l.append(x)
for i in l:
	i.pop(0)
lt = []
for i in range(len(l)):
	if min(l[i]) < m:
		lt.append(i + 1)
print(len(lt))
print(*lt)


(n, v) = map(int, input().split())
ans = []
for _ in range(n):
	l = list(map(int, input().split()))
	it = l[1:]
	it.sort()
	if it[0] < v:
		ans.append(_ + 1)
ans.sort()
print(len(ans))
for i in ans:
	print(i, end=' ')


(n, v) = map(int, input().split())
l = list()
for i in range(n):
	ks = list(map(int, input().split()))
	k = int(ks[0])
	mi = min(ks[1:])
	if mi < v:
		l.append(i + 1)
l.sort()
print(len(l))
for i in range(len(l)):
	print(l[i], end=' ')


buff = list(map(int, input().split()))
n = buff[0]
money = buff[1]
arr = []
lst = []
flag = 1
count = 0
for i in range(n):
	arr.append(list(map(int, input().split())))
	flag = 1
	for j in arr[i]:
		if j < money and flag and (arr[i][0] != j):
			lst.append(i + 1)
			flag = 0
			count += 1
strs = ''
for i in lst:
	strs += str(i)
	strs += ' '
print(count)
print(strs)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase
from fractions import *

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
(n, money) = value()
ans = []
for i in range(n):
	a = array()
	if min(a[1:]) < money:
		ans.append(i + 1)
print(len(ans))
if len(ans) > 0:
	print(*ans)


(n, v) = map(int, input().split())
l1 = []
c = 0
for i in range(n):
	l = list(map(int, input().split()))
	for j in l[1:]:
		if v > j:
			c += 1
			l1.append(i + 1)
			break
print(c)
if len(l1) > 0:
	l1.sort()
	print(*l1)


(n, v) = map(int, input().split())
a = []
cnt = 0
for i in range(n):
	x = list(map(int, input().split()))
	d = x[1:]
	d.sort()
	if d[0] < v:
		cnt += 1
		a.append(i)
print(cnt)
for i in range(cnt):
	print(a[i] + 1, end=' ')


(n, v) = map(int, input().split())
l = []
seller = []
c = 0
for item in range(n):
	l1 = list(map(int, input().split()))
	l1.remove(l1[0])
	l.append(l1)
for (index, item) in enumerate(l):
	for itemm in item:
		if v > itemm:
			c += 1
			seller.append(index)
			break
seller.sort()
print(c)
for item in seller:
	print(item + 1, end=' ')


(n, m) = map(int, input().split())
A = []
sellers = []
for i in range(n):
	a = input().split()
	A.append(a[1:])
for i in A:
	for j in i:
		if m > int(j):
			if A.index(i) + 1 not in sellers:
				sellers.append(A.index(i) + 1)
sellers.sort()
print(len(sellers))
for i in sellers:
	print(i, end=' ')


(n, money) = list(map(int, input().split()))
prices = []
sell = []
for j in range(n):
	ll = list(map(int, input().split()))
	prices.append(ll[1:])
gg = 0
for i in prices:
	gg += 1
	for k in i:
		if k < money:
			sell.append(gg)
			break
seller = list(set(sell))
seller.sort()
print(len(seller))
for h in seller:
	print(h, end=' ')


(n, v) = map(int, input().split())
Ans = []
for i in range(n):
	L = list(map(int, input().split()))
	x = min(L[1:])
	if x < v:
		Ans.append(i)
print(len(Ans))
for item in Ans:
	print(item + 1, end=' ')


t = input().split()
n = int(t[0])
mo = int(t[1])
lis = []
for i in range(n):
	t = input().split()
	flag = False
	for j in range(int(t[0])):
		if mo > int(t[j + 1]):
			flag = True
	if flag:
		lis.append(i + 1)
print(len(lis))
for i in range(len(lis)):
	print(lis[i], end=' ')


(n, v) = map(int, input().split())
count = 0
res = set()
val = set()
sellernum = 0
for i in range(n):
	l = list(map(int, input().split()))
	r = l[0]
	l = l[1:]
	if min(l) < v:
		count += 1
		res.add(i + 1)
myl = []
for i in res:
	myl.append(i)
myl.sort()
print(count)
if count == 0:
	print()
else:
	print(*myl)


(n, v) = map(int, input().split())
qlist = []
slist = []
for i in range(n):
	slist.append(min([int(x) for x in input().split()][1:]))
for i in range(n):
	if slist[i] < v:
		qlist.append(i + 1)
print(len(qlist))
print(''.join([str(qlist[i]) + ' ' for i in range(len(qlist))]))


(n, v) = list(map(int, input().split()))
res = []
for i in range(n):
	l = list(map(int, input().split()))
	t = list(filter(lambda x: x < v, l[1:]))
	if t != []:
		res.append(i + 1)
print(len(res))
res.sort()
print(*res)


(n, v) = map(int, input().split())
a = []
k = 0
p = 0
for i in range(n):
	b = list(map(int, input().split()))
	del b[0]
	b.sort()
	for j in range(len(b)):
		if b[j] < v:
			p += 1
		else:
			break
	if p > 0:
		k += p
		a.append(i + 1)
		p = 0
if len(a) == 0:
	print(0, '\n')
else:
	print(len(a))
	print(*a)


b = [int(b) for b in input().split()]
list = []
for i in range(b[0]):
	c = [int(c) for c in input().split()]
	for j in range(1, len(c)):
		if c[j] < b[1]:
			list.append(i + 1)
			break
print(len(list))
for i in list:
	print(i, end=' ')


(n, m) = [int(i) for i in input().split()]
ans = []
for i in range(n):
	if any((m > int(k) for k in input().split()[1:])):
		ans.append(i + 1)
print(len(ans))
print(*ans)


data = input().split()
(N, V) = (int(data[0]), int(data[1]))
sellers = [None] * N
for i in range(N):
	tmp = input().split()
	sellers[i] = list(map(int, tmp))
deal_sellers = []
for i in range(N):
	current_seller = sellers[i]
	if any((V > e for e in current_seller[1:])):
		deal_sellers.append(i + 1)
print(len(deal_sellers))
print(' '.join(map(str, sorted(deal_sellers))))


(n, v) = map(int, input().split())
ans = []
for i in range(n):
	S = list(map(int, input().split()))[1:]
	S.sort()
	if v > S[0]:
		ans.append(i + 1)
print(len(ans))
print(' '.join(map(str, ans)))


(n, v) = map(int, input().split())
cn = 0
cnli = []
for i in range(n):
	q = list(map(int, input().split()))
	qq = q[1:q[0] + 1]
	qq.sort()
	if qq[0] + 1 <= v:
		cn += 1
		cnli.append(i + 1)
print(cn)
if cn != 0:
	otpt = ' '.join((str(i) for i in cnli))
	print(otpt)


from sys import stdin, stdout
(n, money) = map(int, stdin.readline().strip().split())
oks = []
for i in range(n):
	ls = list(map(int, stdin.readline().strip().split()))
	ls = ls[1:]
	flag = False
	for j in ls:
		if j < money:
			flag = True
			break
	if flag:
		oks.append(i + 1)
stdout.write('%d\n' % len(oks))
for i in range(len(oks)):
	stdout.write('%d' % oks[i])
	if i != len(oks) - 1:
		stdout.write(' ')
if len(oks) != 0:
	stdout.write('\n')


(a, b) = map(int, input().split())
k = []
for i in range(1, a + 1):
	(c, *d) = map(int, input().split())
	if min(d) < b:
		k += [i]
print(len(k), '\n', *k)


(n, v) = [int(i) for i in input().split()]
sellerList = []
for i in range(0, n):
	sellerList.append([int(i) for i in input().split()])
sellerDealList = []
for (i, j) in enumerate(sellerList):
	if v > min(j[1:]):
		sellerDealList.append(str(i + 1))
print(f"{len(sellerDealList):d}\n{' '.join(sellerDealList):s}")


(n, v) = map(int, input().split())
ls = []
for i in range(n):
	if v > min(list(map(int, input().split()))[1:]):
		ls += [i + 1]
print(len(ls))
print(*ls)


(n, m) = map(int, input().split())
b = []
cnt = 0
no = 0
for i in range(n):
	a = list(map(int, input().split()))
	no += 1
	d = a.pop(0)
	if min(a) < m:
		cnt += 1
		b.append(no)
print(cnt)
if cnt > 0:
	print(*b, sep=' ')


(n, v) = map(int, input().split())
sel = []
for j in range(n):
	(no, *item) = map(int, input().split())
	for i in item:
		if i < v:
			sel.append(j + 1)
			break
print(len(sel))
print(*sorted(sel), sep=' ')


(n, v) = map(int, input().split())
seller = []
count = 0
for i in range(n):
	k = list(map(int, input().split()))
	for price in k[1:]:
		if price < v:
			seller.append(i + 1)
			count += 1
			break
if count == 0:
	print(0)
else:
	seller.sort()
	print(count)
	for i in seller:
		print(i, end=' ')


(n, m) = map(int, input().split())
p = 0
t = ''
for i in range(n):
	l = list(map(int, input().split()))
	l = l[1:]
	l.sort()
	if l[0] < m:
		p += 1
		t += str(i + 1) + ' '
	l = []
print(p)
print(t)


line = input()
line = line.split()
n = int(line[0])
pur = int(line[1])
list = []
for i in range(0, n):
	line = input()
	line = line.split()
	m = int(line[0])
	for j in range(1, m + 1):
		price = int(line[j])
		if pur > price:
			list.append(i + 1)
			break
print(len(list))
if len(list) > 0:
	string = ''
	for k in range(0, len(list)):
		string = string + str(list[k]) + ' '
	print(string)


from collections import OrderedDict
(n, v) = map(int, input().split())
pr = {}
for i in range(n):
	t = list(map(int, input().split()))[1:]
	pr[i + 1] = min(t)
pr = OrderedDict(sorted(pr.items(), key=lambda x: x[1]))
k = 0
rr = []
for i in pr:
	if pr[i] < v:
		k += 1
		rr.append(i)
print(k)
rr.sort()
print(*rr, sep=' ')


(n, v) = map(int, input().split())
l = []
for i in range(n):
	ll = input().split()
	ll.pop(0)
	l.append(list(map(int, ll)))
count = 0
ans = []
for i in range(n):
	if any((x < v for x in l[i])):
		count = count + 1
		ans.append(i + 1)
if count == 0:
	print(count)
else:
	print(count)
	for i in range(len(ans)):
		print(ans[i], end=' ')


(n, v) = map(int, input().split())
p = 0
q = []
for i in range(n):
	k = list(map(int, input().split()))
	km = min(k[1:])
	if km < v:
		p += 1
		q.append(i + 1)
print(p)
for x in q:
	print(x, end=' ')


import sys
from math import *
input = sys.stdin.readline
RI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw = lambda : input().strip().split()
ls = lambda : list(input().strip())
from collections import defaultdict as df
import heapq
infinite = float('inf')
(n, v) = RI()
ans = []
for i in range(n):
	l = RI()
	for j in range(1, l[0] + 1):
		if l[j] < v:
			ans.append(i + 1)
			break
print(len(ans))
print(*ans, sep=' ')


(n, m) = map(int, input().split())
from collections import defaultdict
d = defaultdict(list)
ans = []
for i in range(n):
	a = list(map(int, input().split()))
	b = min(a[1:])
	if b < m:
		ans.append(i + 1)
if ans:
	print(len(ans))
	print(*sorted(ans))
else:
	print(0)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(n, v) = LI()
	a = [LI() for _ in range(n)]
	r = []
	for i in range(n):
		if min(a[i][1:]) < v:
			r.append(i + 1)
	return '{}\n{}'.format(len(r), ' '.join(map(str, r)))
print(main())


(n, val) = map(int, input().split())
a = []
for i in range(1, n + 1):
	arr = list(map(int, input().split()))[1:]
	for cost in arr:
		if cost < val:
			a.append(i)
			break
print(len(a))
print(' '.join([str(i) for i in a]))


(x, y) = [int(x) for x in input('').split()]
cout = 0
l = []
s = ''
for i in range(x):
	ar = list(map(int, input().strip('').split()))
	for j in range(1, len(ar)):
		if ar[j] < y:
			l.append(i + 1)
l = set(l)
l = sorted(l)
for i in l:
	s = s + str(i) + ' '
print(len(l))
print(s[0:-1])


(n, v) = map(int, input().split())
flag = 0
(lis, lis2) = ([], [])
for i in range(n):
	lis = input()
	lis = lis.split()
	del lis[0]
	for item in lis:
		if v > int(item):
			flag = 1
	if flag == 1:
		lis2.append(i + 1)
	flag = 0
print(len(lis2))
print(*lis2)


(p, v) = map(int, input().split())
ans = []
for i in range(p):
	d = list(map(int, input().split()))
	d.pop(0)
	if min(d) < v:
		ans.append(i + 1)
print(len(ans))
print(*ans)


def main():
	(n, v) = map(int, input().split(' '))
	r = []
	for i in range(n):
		if v > min(list(map(int, input().split(' ')[1:]))):
			r.append(str(i + 1))
	print(len(r))
	if len(r) > 0:
		print(' '.join(r))
main()


s = input('')
(n, v) = s.split()
n = int(n)
v = int(v)
count = 0
series = []
for i in range(n):
	s1 = input('')
	l = s1.split(' ')
	l = list(map(int, l))
	for j in range(1, len(l)):
		if l[j] < v:
			count += 1
			series.append(i + 1)
			break
if count == 0:
	print(count, end='\n')
else:
	print(count, end='\n')
	for i in series:
		print(i, end=' ')


(n, v) = input().split()
(n, v) = [int(n), int(v)]
sel = []
ct = 0
for j in range(n):
	k = []
	k = list(map(int, input().split()))
	num = k.pop(0)
	for i in range(0, num):
		if v > k[i]:
			sel.append(j + 1)
			ct = ct + 1
			break
print(ct)
if ct > 0:
	sel = sorted(sel)
	for j in range(ct):
		print(sel[j], end=' ')


a = input().split()
seller = int(a[0])
money = int(a[1])
m = 0
s = []
for i in range(seller):
	b = input().split()
	number = int(b[0])
	for k in range(number):
		if money > int(b[k + 1]):
			m = m + 1
			s.append(i + 1)
			break
print(m)
if m > 0:
	r = str(s[0])
	for t in range(1, len(s)):
		r = r + ' ' + str(s[t])
	print(r)


s = []
(n, m) = map(int, input().split())
for q in range(n):
	(a, *l) = map(int, input().split())
	if min(l) < m:
		s.append(q + 1)
print(len(s))
print(*s)


(n, v) = map(int, input().split())
w = []
for i in range(n):
	l = list(map(int, input().split()))
	l.remove(l[0])
	l.sort()
	if l[0] < v:
		w.append(i + 1)
if len(w) == 0:
	print(0)
else:
	w.sort()
	print(len(w))
	print(*w)


(n, c) = map(int, input().split())
o = []
for i in range(n):
	l = list(map(int, input().split()))
	(seller, q) = (l[0], sorted(l[1:]))
	if q[0] < c:
		o.append(i + 1)
print(len(o))
print(*sorted(o))


(n, v) = list(map(int, input().split()))
l = []
for i in range(n):
	l.append(list(map(int, input().split())))
m = []
for i in range(n):
	if v > min(l[i][1:len(l[i])]):
		m.append(i + 1)
if len(m) > 0:
	print(len(m))
	for i in range(len(m) - 1):
		print(m[i], end=' ')
	print(m[len(m) - 1])
else:
	print(0)


(n, v) = map(int, input().split())
s = 0
index = ''
for i in range(n):
	seller = list(map(int, input().split()))
	for j in range(1, 1 + seller[0]):
		if seller[j] < v:
			s += 1
			index += str(i + 1) + ' '
			break
print(s)
print(index[:-1])


(n, v) = map(int, input().split())
t = []
for i in range(n):
	l = list(map(int, input().split()))
	t.append(l)
y = 1
z = []
for x in t:
	for j in range(1, x[0] + 1):
		if x[j] < v:
			z.append(y)
			break
	y = y + 1
print(len(z))
print(*z)


(n, v) = map(int, input().split())
l1 = []
for i in range(n):
	l = list(map(int, input().split()))
	l[1:] = sorted(l[1:])
	if l[1] < v:
		l1.append(i + 1)
print(len(l1))
l1.sort()
for k in range(len(l1)):
	print(l1[k], end=' ')


(a, b) = input().split()
a = int(a)
b = int(b)
la = []
for i in range(a):
	li = list(map(int, input().split()))
	l = li[1:]
	s = li[0]
	j = min(l)
	if j < b:
		la.append(i + 1)
if la == []:
	print(0)
else:
	print(len(la))
	for i in la:
		print(i, end=' ')


(n, m) = map(int, input().split())
ans = 0
an = []
for i in range(n):
	lis = list(map(int, input().split()))
	if min(lis[1:]) < m:
		ans += 1
		an.append(i + 1)
print(ans)
print(*an)


(n, v) = map(int, input().split())
l = []
c = 0
for i in range(n):
	arr = [int(i) for i in input().split()]
	arr.sort()
	if arr[1] < v:
		c = c + 1
		l.append(i + 1)
print(c)
print(*l)


(n, m) = map(int, input().split())
(y, x1) = ([], [])
d = 0
for i in range(n):
	x = list(map(int, input().split()))
	x.pop(0)
	for j in range(len(x)):
		if x[j] < m:
			x1.append(i + 1)
x1 = list(set(x1))
x1.sort()
print(len(x1))
print(*x1)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect, insort
from time import perf_counter
from fractions import Fraction
import copy
from copy import deepcopy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(*ele, end='\n')
(n, v) = L()
A = [L() for i in range(n)]
cnt = 0
ans = []
i = 1
for ele in A:
	if sorted(ele[1:])[0] < v:
		cnt += 1
		ans.append(i)
	i += 1
print(cnt)
print(*ans)
endtime = time.time()


(n, k) = input().split()
n = int(n)
k = int(k)
dealnum = 0
dealers = []
for i in range(n):
	prices = [int(i) for i in input().split()]
	for j in range(1, len(prices)):
		if prices[j] < k:
			dealnum += 1
			dealers.append(str(i + 1))
			break
print(dealnum)
print(' '.join(dealers))