function trim(s) {
    return s.replace(/^\s+|\s+$/gm, '');
}
function tokenize(s) {
    return trim(s).split(/\s+/);
}
function tokenizeIntegers(s) {
    var tokens = tokenize(s);
    for(var i=0; i<tokens.length; ++i) {
        tokens[i]=parseInt(tokens[i]);
    }
    return tokens;
}
function main() {
    var data = tokenizeIntegers(readline());
    var sequenceLength=data[0], totalScore=data[1];
    if(sequenceLength==1) {
        print(totalScore==0?1:-1);
        return;
    }
    if(Math.floor(sequenceLength/2)>totalScore) {
        print(-1);
        return;
    }
    var arr=[];
    var x=totalScore-Math.floor((sequenceLength-2)/2);
    arr[0]=x;
    arr[1]=x*2;
    for(var i=2; i<sequenceLength; ++i) {
        arr[i]=x*2+i;
    }
    print(arr.join(" "));
}
main();

;(function () {

	print(function (n, k) {

		var t = Math.floor(n/2);

		if (k < t) return -1;
		if (n === 1 && k !== 0) return -1;

		var result = [k - t + 1];
		if (result.length < n) result.push(result[0] * 2);
		while (result.length < n) result.push(result.slice(-1)[0] + 1);

		return result.join(' ');

	}.apply(null, readline().split(' ').map(Number)));

}.call(this));

function trim(s) {
    return s.replace(/^\s+|\s$/gm, '');
}
function tokenize(s) {
    return trim(s).split(/\s+/);
}
function integers(s) {
    var tokens=tokenize(s);
    for(var i=0; i<tokens.length; ++i) {
        tokens[i]=parseInt(tokens[i]);
    }
    return tokens;
}
function main() {
    var data = integers(readline());
    var n = data[0], k=data[1];
    if(n==1) {
        if(k==0) {
            print(1);
            return;
        } else {
            print(-1);
            return;
        }
    }
    if(k<Math.floor(n/2)) {
        print(-1);
        return;
    }
    var arr = [];
    var x = k - Math.floor((n-2)/2);
    arr[0]=x;
    arr[1]=x*2;
    for(var i=2; i<n; ++i) {
        arr[i]=x*2+i;
    }
    print(arr.join(" "));
}
main();

function main(){
    var s = readline().split( ' ' ),
        n = s[0] - '',
        k = s[1] - '';

    if (k < Math.floor( n/2 ) || 1 === n && k > 0) {
        print( -1 );
    } else {
        var ans = [k - Math.floor( n/2 ) + 1];
        n > 1 && ans.push( ans[0] * 2 );
        for (var i=2; i<n; i++) {
            ans.push( 900000000 + i );
        }
        print( ans.join( ' ' ) );
    }
}
main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1) {
		print(totalScore == 0 ? 1 : -1);
		return;
	}

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(20000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var rowA = 0, columnA = 0,
		rowB = Math.floor(numPrimes/2), columnB = rowB;

	function advance() {
		++columnA;
		++columnB;
		if (columnB == numPrimes) {
			++rowA;
			++rowB;
			columnA = rowA;
			columnB = rowB;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[rowA]*primes[columnA];
			var b = primes[rowB]*primes[columnB];
			advance();
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1) {
		print(totalScore == 0 ? 1 : -1);
		return;
	}

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(20000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [], a = 2, b;
	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			a += 2;
			b = a+1;
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 2 : 3);
	}

	print(sequence.join(" "));
}

main();

;(function () {

	print(function (n, k) {

		var t = Math.floor(n/2);

		if (k < t) return -1;

		var result = [k - t + 1]; result.push(result[0] * 2);
		while (result.length < n) result.push(result.slice(-1)[0] + 1);

		return result.join(' ');

	}.apply(null, readline().split(' ').map(Number)));

}.call(this));

;(function () {

	print(function (n, k) {

		var t = Math.floor(n/2);

		if (k < t) return -1;
		if (n === 1 && k !== 0) return -1;

		var result = [k - t + 1]; result.push(result[0] * 2);
		while (result.length < n) result.push(result.slice(-1)[0] + 1);

		return result.join(' ');

	}.apply(null, readline().split(' ').map(Number)));

}.call(this));

;(function () {

	print(function (n, k) {

		var t = Math.floor(n/2);

		if (k < t) return -1;

		var result = [k - t + 1, k - t + 1];
		while (result.length < n) result.push(1);

		return result.join(' ');

	}.apply(null, readline().split(' ').map(Number)));

}.call(this));

function trim(s) {
    return s.replace(/^\s+|\s$/gm, '');
}
function tokenize(s) {
    return trim(s).split(/\s+/);
}
function integers(s) {
    var tokens=tokenize(s);
    for(var i=0; i<tokens.length; ++i) {
        tokens[i]=parseInt(tokens[i]);
    }
    return tokens;
}
function main() {
    var data = integers(readline());
    var n = data[0], k=data[1];
    if(n==1) {
        if(k==0) {
            print(1);
            return;
        } else {
            print(-1);
            return;
        }
    }
    if(k<n/2) {
        print(-1);
        return;
    }
    var arr = [];
    var x = k - Math.floor((n-2)/2);
    arr[0]=x;
    arr[1]=x*2;
    for(var i=2; i<n; ++i) {
        arr[i]=x*2+i;
    }
    print(arr.join(" "));
}
main();

function trim(s) {
    return s.replace(/^\s+|\s+$/gm, '');
}
function tokenize(s) {
    return trim(s).split(/\s+/);
}
function tokenizeIntegers(s) {
    var tokens = tokenize(s);
    for(var i=0; i<tokens.length; ++i) {
        tokens[i]=parseInt(tokens[i]);
    }
    return tokens;
}
function main() {
    var data = tokenizeIntegers(readline());
    var sequenceLength=data[0], totalScore=data[1];
    if(sequenceLength==1) {
        print(totalScore==0?1:-1);
        return;
    }
    if(Math.floor(sequenceLength/2)>totalScore) {
        print(-1);
        return;
    }
    var arr=[];
    var x=totalScore-Math.floor((sequenceLength-2)/2);
    arr[0]=x;
    arr[1]=x*2;
    for(var i=2; i<sequenceLength; ++i) {
        arr[i]=x*2+i;
    }
    print(arr);
}
main();

function trim(s) {
    return s.replace(/^\s+|\s+$/gm, '');
}
function tokenize(s) {
    return trim(s).split(/\s+/);
}
function tokenizeIntegers(s) {
    var tokens = tokenize(s);
    for(var i=0; i<tokens.length; ++i) {
        tokens[i]=parseInt(tokens[i]);
    }
    return tokens;
}
function main() {
    var data = tokenizeIntegers(readline());
    var sequenceLength=data[0], totalScore=data[1];
    if(sequenceLength==1) {
        print(totalScore==0?1:-1);
        return;
    }
    if(Math.floor(sequenceLength/2)>totalScore) {
        print(-1);
        return;
    }
    var arr=[];
    var x=totalScore-(sequenceLength-2)/2;
    arr[0]=x;
    arr[1]=x*2;
    for(var i=2; i<sequenceLength; ++i) {
        arr[i]=x*2+i;
    }
    print(arr.join(" "));
}
main();

function trim(s) {
    return s.replace(/^\s+|\s+$/gm, '');
}
function tokenize(s) {
    return trim(s).split(/\s+/);
}
function tokenizeIntegers(s) {
    var tokens = tokenize(s);
    for(var i=0; i<tokens.length; ++i) {
        tokens[i]=parseInt(tokens[i]);
    }
    return tokens;
}
function main() {
    var data = tokenizeIntegers(readline());
    var sequenceLength=data[0], totalScore=data[1];
    if(sequenceLength==1) {
        print(totalScore==0?1:-1);
        return;
    }
    if(Math.floor(sequenceLength/2)>totalScore) {
        print(-1);
        return;
    }
    var x=totalScore-(sequenceLength-2)/2;
    print(x+ " " + x*2);
    for(var i=2; i<sequenceLength; ++i) {
        print(x*2+i + " ");
    }
}
main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1) {
		print(totalScore == 0 ? 1 : -1);
		return;
	}

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(10000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var rowA = 0, rowB = Math.floor(numPrimes/2),
		columnA = 0, columnB = numPrimes-1;

	function advance() {
		++columnA;
		--columnB;
		if (columnB <= columnA) {
			++rowA;
			++rowB;
			columnA = 0;
			columnB = numPrimes-1;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[rowA]*primes[columnA];
			var b = primes[rowB]*primes[columnB];
			advance();
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1) {
		print(totalScore == 0 ? 1 : -1);
		return;
	}

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(10000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var row = 0, column = 0, oppositeColumn = numPairs-1;

	function advance() {
		++column;
		--oppositeColumn;
		if (oppositeColumn <= column) {
			row += 2;
			column = 0;
			oppositeColumn = numPairs-1;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[row]*primes[column];
			var b = primes[row+1]*primes[oppositeColumn];
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
			advance();
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(10000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var row = 0, column = 0, oppositeColumn = numPairs-1;

	function advance() {
		++column;
		--oppositeColumn;
		if (oppositeColumn <= column) {
			row += 2;
			column = 0;
			oppositeColumn = numPairs-1;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[row]*primes[column];
			var b = primes[row+1]*primes[oppositeColumn];
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
			advance();
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(10000),
		numPrimes = primes.length;
	print(numPrimes);

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var row = 0, column = 0, oppositeColumn = numPairs-1;

	function advance() {
		++column;
		--oppositeColumn;
		if (oppositeColumn <= column) {
			row += 2;
			column = 0;
			oppositeColumn = numPairs-1;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[row]*primes[column];
			var b = primes[row+1]*primes[oppositeColumn];
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
			advance();
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1) {
		print(totalScore == 0 ? 1 : -1);
		return;
	}

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(20000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var rowA = 0, rowB = Math.floor(numPrimes/2),
		columnA = 0, columnB = numPrimes-1;

	function advance() {
		++columnA;
		--columnB;
		if (columnB <= columnA) {
			++rowA;
			++rowB;
			columnA = rowA;
			columnB = numPrimes-1-rowA;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[rowA]*primes[columnA];
			var b = primes[rowB]*primes[columnB];
			advance();
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1) {
		print(totalScore == 0 ? 1 : -1);
		return;
	}

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(10000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var row = 0, column = 0, oppositeColumn = numPrimes-1;

	function advance() {
		++column;
		--oppositeColumn;
		if (oppositeColumn <= column) {
			row += 2;
			column = 0;
			oppositeColumn = numPrimes-1;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[row]*primes[column];
			var b = primes[row+1]*primes[oppositeColumn];
			advance();
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
		}
		//print("row = "+row+", column = "+column+", oppositeColumn = "+
		//		oppositeColumn+", a = "+a+", b = "+b);
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1) {
		print(totalScore == 0 ? 1 : -1);
		return;
	}

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(20000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var rowA = 0, columnA = 0,
		rowB = Math.floor(numPrimes/2), columnB = rowB;

	function advance() {
		++columnA;
		++columnB;
		if (columnB <= columnA) {
			++rowA;
			++rowB;
			columnA = rowA;
			columnB = rowB;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[rowA]*primes[columnA];
			var b = primes[rowB]*primes[columnB];
			advance();
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1) {
		print(totalScore == 0 ? 1 : -1);
		return;
	}

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(10000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var row = 0, column = 0, oppositeColumn = numPrimes-1;

	function advance() {
		++column;
		--oppositeColumn;
		if (oppositeColumn <= column) {
			row += 2;
			column = 0;
			oppositeColumn = numPrimes-1;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[row]*primes[column];
			var b = primes[row+1]*primes[oppositeColumn];
			advance();
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
		}
		print("row = "+row+", column = "+column+", oppositeColumn = "+
				oppositeColumn+", a = "+a+", b = "+b);
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1 || Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(10000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var row = 0, column = 0, oppositeColumn = numPairs-1;

	function advance() {
		++column;
		--oppositeColumn;
		if (oppositeColumn <= column) {
			row += 2;
			column = 0;
			oppositeColumn = numPairs-1;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[row]*primes[column];
			var b = primes[row+1]*primes[oppositeColumn];
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
			advance();
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function eratosthenes(max) {
	var mark = new Array(max+1);
	var primes = [];
	var pos = 1;
	while (true) {
		pos += 1;
		while (pos <= max && mark[pos]) {
			pos += 1;
		}
		if (pos > max) {
			break;
		}
		primes.push(pos);
		for (var seek = 2*pos; seek <= max; seek += pos) {
			mark[seek] = true;
		}
	}
	return primes;
}

function main() {
	var data = tokenizeIntegers(readline());
	var sequenceLength = data[0], totalScore = data[1];

	if (sequenceLength == 1) {
		print(totalScore == 0 ? 1 : -1);
		return;
	}

	if (Math.floor(sequenceLength/2) > totalScore) {
		print(-1);
		return;
	}

	var primes = eratosthenes(20000),
		numPrimes = primes.length;

	var numPairs = Math.floor(sequenceLength/2);
	var sequence = [];
	var rowA = 0, rowB = Math.floor(numPrimes/2),
		columnA = 0, columnB = numPrimes-1;

	function advance() {
		++columnA;
		--columnB;
		if (columnB <= columnA) {
			++rowA;
			++rowB;
			columnA = rowA;
			columnB = numPrimes-1;
		}
	}

	var remainder = totalScore + 1 - numPairs;

	for (var pairIndex = numPairs-1; pairIndex > 0; --pairIndex) {
		while (true) {
			var a = primes[rowA]*primes[columnA];
			var b = primes[rowB]*primes[columnB];
			advance();
			if (a != remainder && a != 2*remainder &&
					b != remainder && b != 2*remainder) {
				break;
			}
		}
		sequence.push(a);
		sequence.push(b);
	}

	if (remainder > 0) {
		sequence.push(remainder);
		sequence.push(remainder*2);
	}

	if (sequenceLength % 2 == 1) {
		sequence.push(remainder == 3 ? 5 : 3);
	}

	print(sequence.join(" "));
}

main();


process.stdin.resume();
process.stdin.setEncoding("utf-8");
let standardInputString = "";
let currentLine = 0;

function readLine() {
  return standardInputString[currentLine++];
}

process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});

process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => line.trim());

  main();
});

function main() {
  const t = parseInt(readLine());
  for (let i = 0; i < t; i++) {
    let l = readLine()
      .split(" ")
      .map((el) => parseInt(el));
    let [a, b, x, y, n] = l;

    let [small, large] =
      Math.max(a - n, x) < Math.max(b - n, y)
        ? [
            [a, x],
            [b, y],
          ]
        : [
            [b, y],
            [a, x],
          ];
    let rest = Math.max(-(small[0] - small[1] - n), 0);
    small[0] -= n;
    let finalsmall = BigInt(Math.max(small[0], small[1]));
    large[0] -= rest;
    let finallarge = BigInt(Math.max(large[0], large[1]));

    let res = (finalsmall * finallarge).toString();
    console.log(res);
  }
}

let input = '';
let inputResolve;
let inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => inputResolve());

function For(a, b, cb) {
  let res;
  if (a < b) {
    for (let i = a; i < b; i++) {
      if ((res = cb(i)) !== undefined) return res;
    }
  } else {
    for (let i = b - 1; i >= a; i--) {
      if ((res = cb(i)) !== undefined) return res;
    }
  }
}

function gcd(a, b) {
  if (!b) return a;
  return gcd(b, a % b);
}
function mod(a, n, m) {
  if (n == 0n) return 1n;
  if (n % 2n == 0n) return mod(a * a % m, n / 2n, m);
  return a * mod(a, n - 1n, m) % m;
}
function extendedEuclid(a, b) {
  if (!b) return [1, 0];
  else {
    let [x, y] = extendedEuclid(b, a % b);
    return [y, x - (a / b | 0) * y];
  }
}

function max(a, b) {
  if (a > b) return a;
  return b;
}

(async () => {
  await inputPromise;
  let inp = input.split(/\D+/).map(v => +v); r = 0;
  let t = inp[r++];
  For(0, t, i => {
    let [a, b, x, y, n] = inp.slice(r, r = r + 5).map(v => BigInt(v));
    let min1, min2;
    if (n >= b - y) min1 = y * max(x, a - (n - (b - y)));
    else min1 = a * (b - n);
    if (n >= a - x) min2 = x * max(y, b - (n - (a - x)));
    else min2 = b * (a - n);
    console.log(min1 < min2 ? min1 + '' : min2 + '');
  })
})();

process.stdin.resume();
process.stdin.setEncoding("utf-8");
let standardInputString = "";
let currentLine = 0;

function readLine() {
  return standardInputString[currentLine++];
}

process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});

process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => line.trim());

  main();
});

function main() {
  const t = parseInt(readLine());
  for (let i = 0; i < t; i++) {
    let l = readLine()
      .split(" ")
      .map((el) => parseInt(el));
    let [a, b, x, y, n] = l;

    let [small, large] =
      Math.max(a - n, x) < Math.max(b - n, y)
        ? [
            [a, x],
            [b, y],
          ]
        : [
            [b, y],
            [a, x],
          ];
    let rest = Math.max(-(small[0] - small[1] - n), 0);
    small[0] -= n;
    let finalsmall = Math.max(small[0], small[1]);
    large[0] -= rest;
    let finallarge = Math.max(large[0], large[1]);

    console.log(finalsmall * finallarge);
  }
}

process.stdin.resume();
process.stdin.setEncoding("utf-8");
let standardInputString = "";
let currentLine = 0;

function readLine() {
  return standardInputString[currentLine++];
}

process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});

process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => line.trim());

  main();
});

function main() {
  const t = parseInt(readLine());
  for (let i = 0; i < t; i++) {
    let l = readLine()
      .split(" ")
      .map((el) => parseInt(el));
    let [a, b, x, y, n] = l;

    let [small, large] =
      a < b
        ? [
            [a, x],
            [b, y],
          ]
        : [
            [b, y],
            [a, x],
          ];
    let rest = Math.max(-(small[0] - small[1] - n), 0);
    small[0] -= n;
    small = Math.max(small[0], small[1]);
    large[0] -= rest;
    large = Math.max(large[0], large[1]);

    console.log(large * small);
  }
}

let input = '';
let inputResolve;
let inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => inputResolve());

function For(a, b, cb) {
  let res;
  if (a < b) {
    for (let i = a; i < b; i++) {
      if ((res = cb(i)) !== undefined) return res;
    }
  } else {
    for (let i = b - 1; i >= a; i--) {
      if ((res = cb(i)) !== undefined) return res;
    }
  }
}

function gcd(a, b) {
  if (!b) return a;
  return gcd(b, a % b);
}
function mod(a, n, m) {
  if (n == 0n) return 1n;
  if (n % 2n == 0n) return mod(a * a % m, n / 2n, m);
  return a * mod(a, n - 1n, m) % m;
}
function extendedEuclid(a, b) {
  if (!b) return [1, 0];
  else {
    let [x, y] = extendedEuclid(b, a % b);
    return [y, x - (a / b | 0) * y];
  }
}

(async () => {
  await inputPromise;
  let inp = input.split(/\D+/).map(v => +v); r = 0;
  let t = inp[r++];
  For(0, t, i => {
    let [a, b, x, y, n] = inp.slice(r, r = r + 5);
    let min1, min2;
    if (n >= b - y) min1 = y * Math.max(x, a - (n - (b - y)));
    else min1 = a * (b - n);
    if (n >= a - x) min2 = x * Math.max(y, b - (n - (a - x)));
    else min2 = b * (a - n);
    console.log(Math.min(min1, min2));
  })
})();


var howManyToChange = function ( s ) {
  var letters,
    engLettersCount = 26;
  if ( s.length > engLettersCount ) {
    return;
  }

  letters = new Set( s );
  return s.length - letters.size;
};

readline();
var toChange = howManyToChange( readline() );
if ( typeof toChange === "undefined" ) {
  print( -1 );
} else {
  print( toChange );
}

function getInput() {
    var line = readline();
    var lines = [line];
    while (line = readline()) {
        lines.push(line);
    }
    return lines;
}

var alphabet = "abcdefghijklmnopqrstuvwxyz";
var lastIndex = 0;

function main() {
	var input = getInput();
	var str = input[1];

    if (str.length > alphabet.length) {
        print(-1);
        return;
    }
    var c = 0;
    str.split('').forEach((item, index, arr) => {
       var ind = arr.indexOf(item, index + 1);
       if (ind !== -1) {
           c++;
       }
    });
	print(c);
}

function _main() {
	var input = getInput();
	var str = input[1];
	var res = solve(str);

	if (res === undefined) {
	    print(-1);
	    return;
	}

	var c = 0;
	for(var i = 0, k = str.length; i < k; i++) {
	    if (res[i] !== str[i]) {
	        c++;
	    }
	}
	print(c);
}

function solve(str, a) {
	if (lastIndex > alphabet.length) {
	    return undefined;
	}

	var changed = false;
	var answ = str.split('').map((item, i, arr) => {
		var ind = arr.indexOf(item, i + 1);
		if (ind !== -1 && ind !== i) {
			changed = true;
			return alphabet[lastIndex++];
		}
		return item;
	}).join('');

	return changed ? solve(answ) : answ;
}

main();

function main(n,str){

      var chars = {};
      var cnt = 0;

      if(n > 26){
        print(-1);
        return;
      }

      for(var i = 0 ; i < n ; i++){
        if(chars[str[i]] !== 1)chars[str[i]] = 1;
        else cnt++;
      }
    print(cnt);
}

var n = parseInt(readline());

// var arr = readline().split(' ');
// for(var i = 0  ; i < arr.length ; i++)arr[i] = parseInt(arr[i]);

var str = readline();

main(n,str);

var n = +readline();
if (n > 26) {
    print(-1)
} else {
    print(n - new Set(readline()).size)
}

var n = +readline();
print(n > 26 ? -1: n - new Set(readline()).size);

var n = parseInt(readline());

var s = readline().trim();

var e = new Set(s.split(''));

var ans=s.length-Array.from(e).length;
print(s.length>26?-1:ans)

var n = +readline();
if (n > 26) {
    print(-1)
} else {
    var s = readline();
    print(s.length - new Set(s).size)
}

var n = Number(readline());
var string = readline().split('').map(String);

// create an object to keep track of how many times each letter is present in the original string
var count = {};

for (var i = 0; i < n; i++) {
	if (string[i] in count) {
		count[string[i]] += 1;
	} else {
		count[string[i]] = 1;
	}
}

var letters = Object.keys(count).length // how many distinct letters are int the original string

var changes = 0;

for (var key in count) {
	if (count[key] >= 2) {
		changes += count[key] - 1;
	}
}

// If I would have to change more letters than whatever letters are still available, then it's impossible
if (changes > 26 - letters) {
	changes = -1;
}

print(changes);

function main() {
    var n = Number(readline());
    var s = String(readline());

    if (s.length > 26) {
        print(-1);
        return;
    }

    var count = new Array(26);
    var i = 0;
    for (i = 0; i < 26; ++i) {
        count[i] = 0;
    }
    var a_code = "a".charCodeAt(0);
    for (i = 0; i < n; ++i) {
        var j = s.charCodeAt(i) - a_code;
        ++count[j];
    }

    var ans = 0;
    for (i = 0; i < 26; ++i) {
        if (count[i] > 1) {
            ans += count[i] - 1;
        }
    }

    print(ans);
}

main();

var n = +readline();
var s = readline();

const aCode = 'a'.charCodeAt(0);
const zCode = 'z'.charCodeAt(0);
const cardinality = zCode - aCode + 1;

if (s.length > cardinality) {
  write('-1');
  quit();
}

var u = [...new Set(s)].join('');

write(s.length - u.length)

function rda(){ return readline().split(" ").map(Number); }
function rdn(){ return +readline(); }

var n = rdn();
var s = readline().split("");

var ans;
if(n > 26){
    ans = -1;
}else{
    var u = [];
    for(var i = 0; i < n; i++){
        if(u.indexOf(s[i]) == -1) u.push(s[i]);
    }
    ans = n-u.length;
}

write(ans);

var n = parseInt(readline());
var str = readline();

if (n > 26) {
	print("-1");
}
else {
	var s = {};
	for (var i = 0; i < n; i++) {
		s[str[i]] = true;
	}

	print(n - Object.keys(s).length);
}

"use strict";

function main() {
	var n = parseInt(readline());
	var str = readline();

	if (n > 26) {
		print("-1");
		return;
	}

	var s = {};
	for (let i = 0; i < n; i++) {
		s[str[i]] = true;
	}

	print(n - Object.keys(s).length);
}

main();

function main() {
	var n = parseInt(readline());
	var str = readline();

	if (n > 26) {
		print("-1");
		return;
	}

	var s = {};
	for (var i = 0; i < n; i++) {
		s[str[i]] = true;
	}

	print(n - Object.keys(s).length);
}

main();

var n = parseInt(readline());

var s = readline().trim();

var e = new Set(s.split(''));

var ans=s.length-Array.from(e).length;
print(ans>=26?-1:ans)

var n = parseInt(readline());

var s = readline().trim();

var e = new Set(s.split(''));

var ans=s.length-Array.from(e).length;
print(ans>=24?-1:ans)

var n = parseInt(readline());

var s = readline().trim();

var e = new Set(s.split(''));

var ans=s.length-Array.from(e).length;
print(ans>26?-1:ans)

var n = Number(readline());
var string = readline().split('').map(String);

var count = {};

for (var i = 0; i < n; i++) {
	if (string[i] in count) {
		count[string[i]] += 1;
	} else {
		count[string[i]] = 1;
	}
}

var changes = 0;

for (var key in count) {
	if (count[key] >= 2) {
		changes += count[key] - 1;
	}
}

print(changes);

var n = Number(readline());
var string = readline().split('').map(String);

var count = {};

for (var i = 0; i < n; i++) {
	if (string[i] in count) {
		count[string[i]] += 1;
	} else {
		count[string[i]] = 1;
	}
}

var changes = 0;

for (var key in count) {
	if (count[key] >= 2) {
		changes += count[key] - 1;
	}
}

print(JSON.stringify(count));
print(changes);

var n = +readline();
var s = readline();

const aCode = 'a'.charCodeAt(0);
const zCode = 'z'.charCodeAt(0);
const cardinality = zCode - aCode;

if (s.length > cardinality) {
  write('-1');
  quit();
}

var u = [...new Set(s)].join('');

write(s.length - u.length)

function getInput() {
    var line = readline();
    var lines = [line];
    while (line = readline()) {
        lines.push(line);
    }
    return lines;
}

var alphabet = "abcdefghijklmnopqrstuvwxyz";
var lastIndex = 0;

function main() {
	var input = getInput();
	var str = input[1];
	var res = solve(str);

	if (res === undefined) {
	    print(-1);
	    return;
	}

	var c = 0;
	for(var i = 0, k = str.length; i < k; i++) {
	    if (res[i] !== str[i]) {
	        c++;
	    }
	}
	print(c, res);
}

function solve(str, a) {
	if (lastIndex > alphabet.length) {
	    return undefined;
	}

	var changed = false;
	var answ = str.split('').map((item, i, arr) => {
		var ind = arr.indexOf(item, i + 1);
		if (ind !== -1 && ind !== i) {
			changed = true;
			return alphabet[lastIndex++];
		}
		return item;
	}).join('');

	return changed ? solve(answ) : answ;
}

main();

function getInput() {
    var line = readline();
    var lines = [line];
    while (line = readline()) {
        lines.push(line);
    }
    return lines;
}

var alphabet = "abcdefghijklmnopqrstuvwxyz";
var lastIndex = 0;

function main() {
	var input = getInput();
	var str = input[1];
	var res = solve(str);

	if (res === undefined) {
	    print(-1);
	    return;
	}

	var c = 0;
	for(var i = 0, k = str.length; i < k; i++) {
	    if (res[i] !== str[i]) {
	        c++;
	    }
	}
	print(c);
}

function solve(str, a) {
	if (lastIndex > alphabet.length) {
	    return undefined;
	}

	var changed = false;
	var answ = str.split('').map((item, i, arr) => {
		var ind = arr.indexOf(item, i + 1);
		if (ind !== -1 && ind !== i) {
			changed = true;
			return alphabet[lastIndex++];
		}
		return item;
	}).join('');

	return changed ? solve(answ) : answ;
}

main();

function getInput() {
    var line = readline();
    var lines = [line];
    while (line = readline()) {
        lines.push(line);
    }
    return lines;
}

var alphabet = "abcdefghijklmnopqrstuvwxyz";
var lastIndex = 0;

function main() {
	var input = getInput();
	var str = input[1];
	var res = solve(str);
	var c = 0;
	for(var i = 0, k = str.length; i < k; i++) {
	    if (res[i] !== str[i]) {
	        c++;
	    }
	}
	print(c);
}

function solve(str) {
	var changed = false;
	var answ = str.split('').map((item, i, arr) => {
		var ind = arr.indexOf(item, i + 1);
		if (ind !== -1 && ind !== i) {
			changed = true;
			return alphabet[lastIndex++];
		}
		return item;
	}).join('');

	return changed ? solve(answ) : answ;
}

main();


var nextToken = new function() {
    var line = [];
    var lineIndex = 0;

    return function() {
        while (lineIndex >= line.length) {
            line = readline().split(/\s+/);
            lineIndex = 0;
        }

        return line[lineIndex++];
    }
}();

var nextInt = function() {
    return parseInt(nextToken(), 10);
};

var main = function () {
    var n = nextInt();
    var v = nextInt();
    var ans = [];
    var i, j, good, cnt, cur;

    for (i = 0; i < n; ++i) {
        cnt = nextInt();
        good = false;

        for (j = 0; j < cnt; ++j) {
            cur = nextInt();
            if (cur < v) {
                good = true;
            }
        }

        if (good) {
            ans.push(i + 1);
        }
    }

    print(ans.length);
    print(ans.join(" "));
};

main();

// 441A     Валера и антиквариат

//var n = parseInt(readline());
var input_line = readline().split(' ').map(Number);
var n = parseInt(input_line[0]);
var v = parseInt(input_line[1]);

var out = '';
var count = 0;

for (var i = 1; i <= n; i++) {
    input_line = readline().split(' ').map(Number);
    for (j = 1; j <= input_line[0]; j ++) {
        if (parseInt(input_line[j]) < v) {
            out += i + ' ';
            count ++;
            break;
        };
    }
};

print(count);
print(out);

const readline = require('readline');

let inputs = [];

// Create readline Interface
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})

// Read Inputs
rl.on('line', lineInput => {
    inputs.push(lineInput);
})

// Excute algorithm
rl.on('close', () => {
    let line1 = inputs[0].split(' ').map(num => +num);
    const n = line1[0];
    const v = line1[1];
    let canDealWith = [];

    for (let i = 1; i < n + 1; i++) {
        const canMakeDeal = inputs[i].split(' ').slice(1).some(price => v > price);
        if (canMakeDeal)
            canDealWith.push(i);
    }

    console.log(canDealWith.length)

    if (canDealWith.length)
        console.log(...canDealWith)

})

var line;
line = readline().split(' ');
var n = parseInt(line[0]), v = parseInt(line[1]);
var ret = '', elems = 0;
for(var i = 0; i < n; i++) {
    line = readline().split(' ');
    var k = parseInt(line[0]);
    var minValue = 1 << 30;
    for(var j = 1; j < line.length; j++) {
        if(minValue > parseInt(line[j])) {
            minValue = parseInt(line[j]);
        }
    }
    if(minValue < v) {
        if(ret.length !== 0) ret += ' ';
        ret += (i + 1);
        ++elems;
    }
}
print(elems);
print(ret);

if (!this.readline) print = console.log, readline = require('./readline');

print(function(n, v) {

  var ans = [];

  for (var i = 0; i < n; i++) {
    var s = readline().split(' ').map(Number);
    for (var j = 1; j <= s.length; j++) {
      if (s[j] < v) {
        ans.push(i + 1);
        break;
      }
    }
  }
  return ans.length + '\n' + ans.sort(function(a, b) {
    return a - b;
  }).join(' ');

}.apply(0, readline().split(' ').map(Number)));

var input = readline().split(" "), n = +input[0], v = +input[1];
var ans = [], id, k;

for(var i = 0; i < n; i++){
	input = readline().split(" ").map(Number);
	id = i+1;
	k = input.shift();

	for(var j = 0; j < k; j++){
		if(v > input[j]){
			ans.push(id);
			break;
		}
	}
}

write(ans.length);
if(ans.length > 0){
	write("\n" + ans.join(" "));
}

function main(n,v,arr){

    var ans = [];
    var index = 0;
    var ansstr = "";

    for(var i = 0 ; i < n ; i++ ){
      for(var j = 1; j < arr[i].length ; j++){
        if(v > parseInt(arr[i][j])){
          ans[index] = parseInt(i)+1;
          index++;
          break;
        }
      }
    }
    if(ans.length === 0){
    print("0")
    return;
    };
    print(ans.length);
    for(var i = 0 ; i<ans.length ; i++)ansstr = ansstr + ans[i] + " ";
    print(ansstr);
}

var nv = readline().split(" ");
for(var i = 0 ; i < nv.length ; i++)nv[i] = parseInt(nv[i]);

var arr = [];
for(var i = 0 ; i < nv[0] ; i++){
  arr[i] = readline().split(" ");
}

main(nv[0],nv[1],arr)

var info = readline().split(' ').map(Number);
var result = "";
var mSell = 0;
var sellers = [];
for (var k=0; k<info[0]; k++) {
    sellers[k] = readline().split(' ').map(Number);
}
for (var i=0; i<info[0]; i++) {
    for (var j=1; j<=sellers[i][0]; j++) {
        if (sellers[i][j] < info[1]) {
            mSell += 1;
            result += (i+1) +" ";
            break;
        }
    }
}
print(mSell);
print(result);

;(function () {

	var n = readline().split(' ').map(Number);
	var t = [];
	for (var i = 0; i < n[0]; i++) {
		var s = readline().split(' ').map(Number);
		for (var j = 1; j < s.length; j++)
			if (s[j] < n[1]) {
				t.push(i + 1);
				break;
			}
	}

	print( t.length );
	if (t.length)
		print( t.join(' ') );

}).call(this);

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i], 10);
	};
	return tokens;
}

function main() {
	var data = tokenizeIntegers(readline()),
		numSellers = data[0], cash = data[1],
		result = [];
	for (var i = 0; i < numSellers; ++i) {
		data = tokenizeIntegers(readline());
		for (var j = 1; j < data.length; ++j) {
			if (data[j] < cash) {
				result.push(i+1);
				break;
			}
		}
	}
	print(result.length);
	if (result.length > 0) {
		print(result.join(' '));
	}
}

main();

var N = readline().split(' ').map(Number),
    r = Array.apply(null, Array(N[0])).map(readline)
    .map(function(v, i) { return [i + 1, v.split(' ').map(Number).slice(1).sort(function(a,b){return a-b})[0]]; })
    .filter(function(_) { return _[1] < N[1] })
    .map(function(_) { return _[0] });

print(r.length + '\n' + r.join(' '));

var N = readline().split(' ').map(Number);

var r = [];
for(var i = 0; i < N[0]; ++i) {
  r.push([i + 1, readline().split(' ').map(Number).slice(1).sort(function(a,b){return a-b})[0]]);
}

r = r.filter(function(_) { return _[1] < N[1] });

print(r.length);
print(r.map(function(_) { return _[0] }).join(' '));

var tokenizer;
var index = 0;

function next(){
    while(tokenizer == null || index == tokenizer.length){
        tokenizer = readline().split(" ");
        index = 0;
    }
    var res = tokenizer[index++];
    return res;
}

function nextInt(){
    return parseInt(next());
}

function nextFloat(){
    return parseFloat(next());
}

function solve(){
    var n = nextInt();
    var v = nextInt();
    var res = 0;
    var s = "";
    for(var i = 0; i < n; ++i){
        var k = nextInt();
        var flag = false;
        for(var j = 0; j < k; ++j){
            var cur = nextInt();
            if(cur < v) flag = true;
        }
        if(flag){
            ++res;
            s += ((i+1) + " ");
        }

    }
    print(res);
    print(s);
}
solve();

var A = [];
var solution = [];
var line = readline();
var n = line.split(' ')[0];
var v = line.split(' ')[1];

for(var i =0; i < n; i++){
    A.push(readline().split(' '));
    for(var j = 1; j <= A[i][0]; j++){
        if(parseInt(A[i][j]) < parseInt(v)){
            solution.push(i+1);
            break;
        }
    }
}

print(solution.length);
print(solution.join(' '));

var n=readline().split(' ').map(Number);
var ss = ((xs)=>{for (var i=0;i<n[0];i++) {xs.push([readline().split(' ').map(Number).slice(1).sort((a,b)=>a-b).shift(),i+1]);} return xs;})([]);
var ps=ss.filter((x)=>n[1]>x[0]);
print(ps.length);
if (ps.length!==0) print(ps.map((xs)=>xs[1].toString()).join(' '));

var line = readline().split(' ').map(Number);
var sellers = [];
var res = "";
var sellersNum = 0;
for (var k = 0; k<line[0]; ++k) {
    sellers[k] = readline().split(' ').map(Number);
    }
for (var i = 0; i<line[0]; ++i) {
    for (var j = 1; j<=sellers[i][0]; ++j) {
            if (sellers[i][j] < line[1]) {
            ++sellersNum;
            res = res + (i + 1) + " ";
            break;
            }
    }
}
print(sellersNum);
print(res);

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=parseInt(lines[1]);

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount.length;j++) {
        if (parseInt(sellersAmount[j])<Amount) {
            sellers.push(i+1);
            break;
        }
    }
}

print(sellers.length);
if (sellers.length>0) {
    print(sellers.join(" "));
}

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=lines[1];

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount.length-1;j++) {
        if (sellersAmount[j]<=Amount) {
            sellers.push(sellersAmount[0]);
            break;
        }
    }
}

print(sellers.length);
if (sellers.length>0) {
    print(sellers);
}

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=lines[1];

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount;j++) {
        if (sellersAmount[j]<=Amount) {
            sellers.push(sellersAmount[0]);
            break;
        }
    }
}

print(sellersAmount.length);
if (sellersAmount.length>0) {
    print(sellers.join(" "));
}

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=lines[1];

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount;j++) {
        if (sellersAmount[j]<=Amount) {
            sellers.push(sellersAmount[0]);
        }
    }
}

print(sellersAmount.length);
if (sellersAmount.length>0) {
    print(sellers);
}

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=lines[1];

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount.length;j++) {
        if (sellersAmount[j]<=Amount) {
            sellers.push(sellersAmount[0]);
            break;
        }
    }
}

print(sellers.length);
if (sellers.length>0) {
    print(sellers);
}

var lines=readline().split(" ");

print(lines);

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=lines[1];

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount-1;j++) {
        if (sellersAmount[j]<=Amount) {
            sellers.push(sellersAmount[0]);
        }
    }
}

print(sellersAmount.length);
if (sellersAmount.length>0) {
    print(sellers);
}

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=lines[1];

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount.length;j++) {
        if (sellersAmount[j]<=Amount) {
            sellers.push(sellersAmount[0]);
            break;
        }
    }
}

print(sellers.length);
if (sellers.length>0) {
    print(sellers.join(" "));
}

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=lines[1];

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount.length-1;j++) {
        if (sellersAmount[j]<=Amount) {
            sellers.push(sellersAmount[0]);
            break;
        }
    }
}

print(sellers.length);
if (sellers.length>0) {
    print(sellers.join(" "));
}

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=parseInt(lines[1]);

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount.length;j++) {
        if (parseInt(sellersAmount[j])<Amount) {
            sellers.push(sellersAmount[0]);
            break;
        }
    }
}

print(sellers.length);
if (sellers.length>0) {
    print(sellers.join(" "));
}

function main(n,v,arr){

    var ans = [];
    var index = 0;
    var ansstr = "";

    for(var i = 0 ; i < n ; i++ ){
      for(var j = 1; j < arr[i].length ; j++){
        if(v > parseInt(arr[i][j])){
          ans[index] = parseInt(arr[i][0]);
          index++;
          break;
        }
      }
    }
    if(ans.length === 0){
    print("0")
    return;
    };
    print(ans.length);
    for(var i = 0 ; i<ans.length ; i++)ansstr = ansstr + ans[i] + " ";
    print(ansstr);
}

var nv = readline().split(" ");
for(var i = 0 ; i < nv.length ; i++)nv[i] = parseInt(nv[i]);

var arr = [];
for(var i = 0 ; i < nv[0] ; i++){
  arr[i] = readline().split(" ");
}

main(nv[0],nv[1],arr)

function main(n,v,arr){

    var ans = [];
    var index = 0;
    var ansstr = "";

    for(var i = 0 ; i < n ; i++ ){
      for(var j = 1; j < arr[i].length ; j++){
        if(v > parseInt(arr[i][j])){
          ans[index] = parseInt(arr[i][0]);
          index++;
          break;
        }
      }
    }
    if(ans.length === 0){
    print("0")
    return;
    };
    print(ans.length);
    ans.sort();
    for(var i = 0 ; i<ans.length ; i++)ansstr = ansstr + ans[i] + " ";
    print(ansstr);
}

var nv = readline().split(" ");
for(var i = 0 ; i < nv.length ; i++)nv[i] = parseInt(nv[i]);

var arr = [];
for(var i = 0 ; i < nv[0] ; i++){
  arr[i] = readline().split(" ");
}

main(nv[0],nv[1],arr)

;(function () {

	var n = readline().split(' ').map(Number);
	var t = [];
	for (var i = 0; i < n[0]; i++) {
		var s = readline().split(' ').map(Number);
		for (var j = 1; j < s.length; j++)
			if (s[j] < n[1]) {
				t.push(i + 1);
				break;
			}
	}

	print( t.length ? t.join(' ') : '0' );

}).call(this);

var A = [];
var solution = [];
var line = readline();
var n = line.split(' ')[0];
var v = line.split(' ')[1];

for(var i =0; i < n; i++){
    A.push(readline().split(' '));
    for(var j = 1; j <= A[i][0]; j++){
        if(parseInt(A[i][j]) < parseInt(v)){
            solution.push(i+1);
            break;
        }
    }
}

print(solution.length);
print(solution);

var line = readline().split(' ').map(Number);
var res = "";
var sellersNum = 0;
var sellers = [];
for (var k = 0; k<line[0]; ++k) {
    sellers[k] = readline().split(' ').map(Number);
    }
for (var i = 0; i<line[0]; ++i) {
    for (var j = 1; j<=sellers[i][0]; ++j) {
            if (sellers[i][j] < line[1]) {
            ++sellersNum,
            res = res + (i+1) + " ";
             }
    }
}
print(sellersNum);
print(res);

// 441A     Валера и антиквариат

//var n = parseInt(readline());
var input_line = readline().split(' ').map(Number);
var n = parseInt(input_line[0]);
var v = parseInt(input_line[1]);

var out = '';
var count = 0;

for (var i = 1; i <= n; i++) {
    input_line = readline().split(' ').map(Number);
    for (j = 1; j <= input_line[0]; j ++) {
        if (parseInt(input_line[j]) < v) {
            out += i + ' ';
            count ++;
        };
    }
};

print(count);
print(out);

// 441A     Валера и антиквариат

//var n = parseInt(readline());
var input_line = readline().split(' ').map(Number);
var n = parseInt(input_line[0]);
var v = parseInt(input_line[1]);

var out = '';
var count = 0;

for (var i = 1; i <= n; i++) {
    input_line = readline().split(' ').map(Number);
    for (j = 1; j <= input_line[0]; j ++) {
        if (parseInt(input_line[j]) <= v) {
            out += i + ' ';
            count ++;
        };
    }
};

print(count);
print(out);

var line;
line = readline().split(' ');
var n = parseInt(line[0]), v = parseInt(line[1]);
var ret = '';
for(var i = 0; i < n; i++) {
    line = readline().split(' ');
    var k = parseInt(line[0]);
    var minValue = 1 << 30;
    for(var j = 1; j < line.length; j++) {
        if(minValue > parseInt(line[j])) {
            minValue = parseInt(line[j]);
        }
    }
    if(minValue < v) {
        if(ret.length !== 0) ret += ' ';
        ret += (i + 1);
    }
}
print(ret.length);
print(ret);

var lines=readline().split(" ");//reads the first line of the input

var noOfSellers=lines[0];
var Amount=lines[1];

var sellersAmount;
var sellers=[];

for (var i=0;i<noOfSellers;i++) {
    sellersAmount=readline().split(" ");
    for(var j=1;j<sellersAmount.length-1;j++) {
        if (sellersAmount[j]<=Amount) {
            sellers.push(sellersAmount[0]);
            break;
        }
    }
}

print(sellersAmount.length);
if (sellersAmount.length>0) {
    print(sellers);
}