Array.prototype.sub_reverse = function(x,y) {
	var a = this;
	var n = a.length;
	for (var i = 0; i+i < (y - x); i++) {
		var temp = a[x+i];
		a[x+i] = a[y-1-i];
		a[y-1-i] = temp;
	}
}

Array.prototype.next_permutation = function(){
	var a = this;
	var n = a.length;
	if (n < 2) return false;

	//Find the largest index k such that a[k] < a[k + 1]. If no such index exists, the permutation is the last permutation.
	for (var k = n-2; k >= 0 && a[k] >= a[k+1]; --k){}
	if (k == -1) return false;

	//Find the largest index l greater than k such that a[k] < a[l].
	for (var l = n-1;  k < l && a[k] >= a[l]; --l){}
	if (k == l) return false;

	//Swap the value of a[k] with that of a[l].
	var temp = a[k];
	a[k] = a[l];
	a[l] = temp;

	//Reverse the sequence from a[k + 1] up to and including the final element a[n].
	a.sub_reverse(k+1,n);
	return true;
}

function solve(a,order) {
	var letter = ["A","B","C"];
	var A = {x:a[0][0], y:a[0][1], letter:letter[order[0]]};
	var B = {x:a[1][0], y:a[1][1], letter:letter[order[1]]};
	var C = {x:a[2][0], y:a[2][1], letter:letter[order[2]]};

	// AA
	// BB
	// CC
	if (A.x == B.x && B.x == C.x && A.x == (A.y + B.y + C.y) ) {
		write(A.x + "\n");
		for (var i = 0; i < A.y; i++) {
			for (var j = 0; j < A.x; j++)
				write(A.letter);
			write("\n");
		}
		for (var i = 0; i < B.y; i++) {
			for (var j = 0; j < B.x; j++)
				write(B.letter);
			write("\n");
		}
		for (var i = 0; i < C.y; i++) {
			for (var j = 0; j < C.x; j++)
				write(C.letter);
			write("\n");
		}
		return true;
	}

	// ABB
	// ACC
	if (B.x == C.x && A.y == (B.y+C.y) && A.y == (A.x + B.x)) {
		write(A.y + "\n");
		for (var i = 0; i < B.y; i++) {
			for (var j = 0; j < A.x; j++) write(A.letter);
			for (var j = 0; j < B.x; j++) write(B.letter);
			write("\n");
		}
		for (var i = 0; i < C.y; i++) {
			for (var j = 0; j < A.x; j++) write(A.letter);
			for (var j = 0; j < C.x; j++) write(C.letter);
			write("\n");
		}
		return true;
	}
	return false;
}

function main() {
	a = readline().split(" ").map(Number);

	var order = [0,1,2];
	do {
		// 2d array
		var b = [];
		for (var i = 0; i < 3; i++) {
			b.push([ a[2*order[i]], a[2*order[i]+1] ]);
		}

		for (var rotation_mask = 0; rotation_mask < 8; rotation_mask++) {
			var c = [];
			// rotate
			for (var i = 0; i < 3; i++)
				if (rotation_mask & (1<<i)) {
					c[i] = b[i].slice(0).reverse();
				} else {
					c[i] = b[i].slice();
				}
			result = solve(c, order);
			if (result) break;
		}
		if (result) break;
	} while (order.next_permutation());

	if (!result) {
		write("-1\n");
	}
}

main();

/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}

/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	var List = __webpack_require__(1);
	var xy = List.map(parseInt, readline().split(' '));
	var Rect = (function () {
	    function Rect(width, height, label) {
	        this.width = width;
	        this.height = height;
	        this.label = label;
	    }
	    Rect.prototype.rotated = function () {
	        return new Rect(this.height, this.width, this.label);
	    };
	    return Rect;
	})();
	var rects = [];
	var label = ["A", "B", "C"];
	for (var i = 0; i < 3; i++) {
	    rects.push(new Rect(xy[2 * i], xy[2 * i + 1], label[i]));
	}
	var infinity = 100000000;
	function square(n) {
	    return List.map(function (_) { return List.replicate(n, "."); }, List.replicate(n, []));
	}
	function draw(canvas, x, y, r) {
	    for (var i = x; i < x + r.width; i++) {
	        for (var j = y; j < y + r.height; j++) {
	            canvas[i][j] = r.label;
	        }
	    }
	}
	function output(canvas) {
	    print(canvas.length);
	    print(List.map(function (s) { return s.join(""); }, canvas).join("\n"));
	}
	function fit(rect) {
	    var width = rect[0].width;
	    var height = rect[0].height;
	    if (rects[1].width > width)
	        return false;
	    height += rect[1].height;
	    if (rect[2].width + rect[1].width === width) {
	        if (rect[2].height !== rect[1].height)
	            return false;
	        if (height !== width)
	            return false;
	        var canvas = square(width);
	        draw(canvas, 0, 0, rect[0]);
	        draw(canvas, 0, rect[0].height, rect[1]);
	        draw(canvas, rect[1].width, rect[0].height, rect[2]);
	        output(canvas);
	        return true;
	    }
	    else {
	        if (rect[1].width != width || rect[2].width != width)
	            return false;
	        height += rect[2].height;
	        if (height != width)
	            return false;
	        var canvas = square(width);
	        draw(canvas, 0, 0, rect[0]);
	        draw(canvas, 0, rect[0].height, rect[1]);
	        draw(canvas, 0, rect[0].height + rect[1].height, rect[2]);
	        output(canvas);
	        return true;
	    }
	}
	var found = false;
	for (var rotation = 0; rotation < 8 && !found; rotation++) {
	    var rotated = [];
	    for (var i = 0; i < 3; i++) {
	        var should_rotate = ((rotation >> i) & 1) !== 0;
	        rotated.push(should_rotate ? rects[i].rotated() : rects[i]);
	    }
	    var p = List.range(0, 2);
	    do {
	        found = found || fit(List.apply_permutation(p, rotated));
	    } while ((p = List.next_permutation(p)) && !found);
	}
	if (!found)
	    print("-1");

/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {

	var Prelude_1 = __webpack_require__(2);
	function add(xs, ys) {
	    return xs.concat(ys);
	}
	exports.add = add;
	function head(xs) {
	    return xs[0];
	}
	exports.head = head;
	function last(xs) {
	    return xs[xs.length - 1];
	}
	exports.last = last;
	function tail(xs) {
	    return xs.slice(1);
	}
	exports.tail = tail;
	function init(xs) {
	    return xs.slice(0, xs.length - 1);
	}
	exports.init = init;
	function map(f, xs) {
	    var result = new Array(xs.length);
	    for (var i = 0; i < xs.length; i++) {
	        result[i] = f(xs[i]);
	    }
	    return result;
	}
	exports.map = map;
	function reverse(xs) {
	    return xs.slice().reverse();
	}
	exports.reverse = reverse;
	function intersperse(x, xs) {
	    if (xs.length == 0) {
	        return [];
	    }
	    var result = new Array(xs.length + xs.length - 1);
	    for (var i = 0; i + 1 < xs.length; i++) {
	        result[i + i] = xs[i];
	        result[i + i + 1] = x;
	    }
	    result[result.length - 1] = xs[xs.length - 1];
	    return result;
	}
	exports.intersperse = intersperse;
	function intercalate(xs, xss) {
	    return concat(intersperse(xs, xss));
	}
	exports.intercalate = intercalate;
	function foldl(f, initial, xs) {
	    var result = initial;
	    for (var i = 0; i < xs.length; i++) {
	        result = f(result, xs[i]);
	    }
	    return result;
	}
	exports.foldl = foldl;
	function foldr(f, initial, xs) {
	    var result = initial;
	    for (var i = xs.length - 1; i >= 0; i--) {
	        result = f(xs[i], result);
	    }
	    return result;
	}
	exports.foldr = foldr;
	function concat(xss) {
	    var total = sum(map(function (xs) { return xs.length; }, xss));
	    var result = new Array(total);
	    var m = 0;
	    for (var i = 0; i < xss.length; i++) {
	        var xs = xss[i];
	        for (var j = 0; j < xs.length; j++) {
	            result[m++] = xs[j];
	        }
	    }
	    return result;
	}
	exports.concat = concat;
	function sum(xs) {
	    var result = 0;
	    for (var i = 0; i < xs.length; i++) {
	        result += xs[i];
	    }
	    return result;
	}
	exports.sum = sum;
	function product(xs) {
	    var result = 1;
	    for (var i = 0; i < xs.length; i++) {
	        result *= xs[i];
	    }
	    return result;
	}
	exports.product = product;
	function maximum(xs) {
	    var result = xs[0];
	    for (var i = 1; i < xs.length; i++) {
	        if (result < xs[i])
	            result = xs[i];
	    }
	    return result;
	}
	exports.maximum = maximum;
	function minimum(xs) {
	    var result = xs[0];
	    for (var i = 1; i < xs.length; i++) {
	        if (result > xs[i])
	            result = xs[i];
	    }
	    return result;
	}
	exports.minimum = minimum;
	function replicate(n, x) {
	    var result = new Array(n);
	    for (var i = 0; i < result.length; i++) {
	        result[i] = x;
	    }
	    return result;
	}
	exports.replicate = replicate;
	function take(n, xs) {
	    return xs.slice(0, n);
	}
	exports.take = take;
	function drop(n, xs) {
	    return xs.slice(n);
	}
	exports.drop = drop;
	function splitAt(n, xs) {
	    return [take(n, xs), drop(n, xs)];
	}
	exports.splitAt = splitAt;
	function takeWhile(f, xs) {
	    for (var i = 0; i < xs.length; i++) {
	        if (!f(xs[i])) {
	            return xs.slice(0, i);
	        }
	    }
	    return xs.slice();
	}
	exports.takeWhile = takeWhile;
	function dropWhile(f, xs) {
	    for (var i = 0; i < xs.length; i++) {
	        if (!f(xs[i])) {
	            return xs.slice(i);
	        }
	    }
	    return [];
	}
	exports.dropWhile = dropWhile;
	function group(xs) {
	    if (xs.length == 0) {
	        return [];
	    }
	    var result = [];
	    var last = [xs[0]];
	    for (var i = 1; i < xs.length; i++) {
	        if (last[0] === xs[i]) {
	            last.push(xs[i]);
	        }
	        else {
	            result.push(last);
	            last = [xs[i]];
	        }
	    }
	    result.push(last);
	    return result;
	}
	exports.group = group;
	function filter(f, xs) {
	    var result = [];
	    for (var i = 0; i < xs.length; i++) {
	        if (f(xs[i]))
	            result.push(xs[i]);
	    }
	    return result;
	}
	exports.filter = filter;
	function zip(xs, ys) {
	    var n = Prelude_1.min(xs.length, ys.length);
	    var result = new Array(n);
	    for (var i = 0; i < n; i++) {
	        result[i] = [xs[i], ys[i]];
	    }
	    return result;
	}
	exports.zip = zip;
	function unzip(xs) {
	    var r1 = new Array(xs.length);
	    var r2 = new Array(xs.length);
	    for (var i = 0; i < xs.length; i++) {
	        r1[i] = xs[i][0];
	        r2[i] = xs[i][1];
	    }
	    return [r1, r2];
	}
	exports.unzip = unzip;
	function range(from, to) {
	    var result = Array(to - from + 1);
	    for (var i = from; i <= to; i++) {
	        result[i - from] = i;
	    }
	    return result;
	}
	exports.range = range;
	function copy(xs) {
	    return xs.slice(0);
	}
	exports.copy = copy;
	function apply_permutation(p, xs) {
	    var n = xs.length;
	    var result = new Array(n);
	    for (var i = 0; i < n; i++) {
	        result[i] = xs[p[i]];
	    }
	    return result;
	}
	exports.apply_permutation = apply_permutation;
	function next_permutation(p) {
	    var n = p.length;
	    if (n < 2)
	        return null;
	    var r = copy(p);
	    var k = n - 2;
	    for (; k >= 0 && r[k] >= r[k + 1]; k--)
	        ;
	    if (k < 0)
	        return null;
	    for (var i = k + 1, j = n - 1; i < j; i++, j--) {
	        var t_1 = r[i];
	        r[i] = r[j];
	        r[j] = t_1;
	    }
	    var next = k + 1;
	    for (; r[next] <= r[k]; next++)
	        ;
	    var t = r[k];
	    r[k] = r[next];
	    r[next] = t;
	    return r;
	}
	exports.next_permutation = next_permutation;

/***/ },
/* 2 */
/***/ function(module, exports) {

	function min(a, b) {
	    return a < b ? a : b;
	}
	exports.min = min;
	function max(a, b) {
	    return a < b ? b : a;
	}
	exports.max = max;
	function curry(f) {
	    return function (x) { return function (y) { return f(x, y); }; };
	}
	exports.curry = curry;
	function uncurry(f) {
	    return function (x, y) { return f(x)(y); };
	}
	exports.uncurry = uncurry;
	function id(x) {
	    return x;
	}
	exports.id = id;
	function constant(x) {
	    return function (_) { return x; };
	}
	exports.constant = constant;
	function flip(f) {
	    return function (y) { return function (x) { return f(x)(y); }; };
	}
	exports.flip = flip;
	function flip2(f) {
	    return function (y, x) { return f(x, y); };
	}
	exports.flip2 = flip2;
	function compose(g, f) {
	    return function (x) { return g(f(x)); };
	}
	exports.compose = compose;

/***/ }
/******/ ]);

/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}

/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	var List = __webpack_require__(1);
	var xy = List.map(parseInt, readline().split(' '));
	var Rect = (function () {
	    function Rect(width, height, label) {
	        this.width = width;
	        this.height = height;
	        this.label = label;
	    }
	    Rect.prototype.rotated = function () {
	        return new Rect(this.height, this.width, this.label);
	    };
	    return Rect;
	})();
	var rects = [];
	var label = ["A", "B", "C"];
	for (var i = 0; i < 3; i++) {
	    rects.push(new Rect(xy[2 * i], xy[2 * i + 1], label[i]));
	}
	var infinity = 100000000;
	function square(n) {
	    return List.map(function (_) { return List.replicate(n, "."); }, List.replicate(n, []));
	}
	function draw(canvas, x, y, r) {
	    for (var i = x; i < x + r.width; i++) {
	        for (var j = y; j < y + r.height; j++) {
	            canvas[i][j] = r.label;
	        }
	    }
	}
	function output(canvas) {
	    print(List.map(function (s) { return s.join(""); }, canvas).join("\n"));
	}
	function fit(rect) {
	    var width = rect[0].width;
	    var height = rect[0].height;
	    if (rects[1].width > width)
	        return false;
	    height += rect[1].height;
	    if (rect[2].width + rect[1].width === width) {
	        if (rect[2].height !== rect[1].height)
	            return false;
	        if (height !== width)
	            return false;
	        var canvas = square(width);
	        draw(canvas, 0, 0, rect[0]);
	        draw(canvas, 0, rect[0].height, rect[1]);
	        draw(canvas, rect[1].width, rect[0].height, rect[2]);
	        output(canvas);
	        return true;
	    }
	    else {
	        if (rect[1].width != width || rect[2].width != width)
	            return false;
	        height += rect[2].height;
	        if (height != width)
	            return false;
	        var canvas = square(width);
	        draw(canvas, 0, 0, rect[0]);
	        draw(canvas, 0, rect[0].height, rect[1]);
	        draw(canvas, 0, rect[0].height + rect[1].height, rect[2]);
	        output(canvas);
	        return true;
	    }
	}
	var found = false;
	for (var rotation = 0; rotation < 8 && !found; rotation++) {
	    var rotated = [];
	    for (var i = 0; i < 3; i++) {
	        var should_rotate = ((rotation >> i) & 1) !== 0;
	        rotated.push(should_rotate ? rects[i].rotated() : rects[i]);
	    }
	    var p = List.range(0, 2);
	    do {
	        found = found || fit(List.apply_permutation(p, rotated));
	    } while ((p = List.next_permutation(p)) && !found);
	}
	if (!found)
	    print("-1");

/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {

	var Prelude_1 = __webpack_require__(2);
	function add(xs, ys) {
	    return xs.concat(ys);
	}
	exports.add = add;
	function head(xs) {
	    return xs[0];
	}
	exports.head = head;
	function last(xs) {
	    return xs[xs.length - 1];
	}
	exports.last = last;
	function tail(xs) {
	    return xs.slice(1);
	}
	exports.tail = tail;
	function init(xs) {
	    return xs.slice(0, xs.length - 1);
	}
	exports.init = init;
	function map(f, xs) {
	    var result = new Array(xs.length);
	    for (var i = 0; i < xs.length; i++) {
	        result[i] = f(xs[i]);
	    }
	    return result;
	}
	exports.map = map;
	function reverse(xs) {
	    return xs.slice().reverse();
	}
	exports.reverse = reverse;
	function intersperse(x, xs) {
	    if (xs.length == 0) {
	        return [];
	    }
	    var result = new Array(xs.length + xs.length - 1);
	    for (var i = 0; i + 1 < xs.length; i++) {
	        result[i + i] = xs[i];
	        result[i + i + 1] = x;
	    }
	    result[result.length - 1] = xs[xs.length - 1];
	    return result;
	}
	exports.intersperse = intersperse;
	function intercalate(xs, xss) {
	    return concat(intersperse(xs, xss));
	}
	exports.intercalate = intercalate;
	function foldl(f, initial, xs) {
	    var result = initial;
	    for (var i = 0; i < xs.length; i++) {
	        result = f(result, xs[i]);
	    }
	    return result;
	}
	exports.foldl = foldl;
	function foldr(f, initial, xs) {
	    var result = initial;
	    for (var i = xs.length - 1; i >= 0; i--) {
	        result = f(xs[i], result);
	    }
	    return result;
	}
	exports.foldr = foldr;
	function concat(xss) {
	    var total = sum(map(function (xs) { return xs.length; }, xss));
	    var result = new Array(total);
	    var m = 0;
	    for (var i = 0; i < xss.length; i++) {
	        var xs = xss[i];
	        for (var j = 0; j < xs.length; j++) {
	            result[m++] = xs[j];
	        }
	    }
	    return result;
	}
	exports.concat = concat;
	function sum(xs) {
	    var result = 0;
	    for (var i = 0; i < xs.length; i++) {
	        result += xs[i];
	    }
	    return result;
	}
	exports.sum = sum;
	function product(xs) {
	    var result = 1;
	    for (var i = 0; i < xs.length; i++) {
	        result *= xs[i];
	    }
	    return result;
	}
	exports.product = product;
	function maximum(xs) {
	    var result = xs[0];
	    for (var i = 1; i < xs.length; i++) {
	        if (result < xs[i])
	            result = xs[i];
	    }
	    return result;
	}
	exports.maximum = maximum;
	function minimum(xs) {
	    var result = xs[0];
	    for (var i = 1; i < xs.length; i++) {
	        if (result > xs[i])
	            result = xs[i];
	    }
	    return result;
	}
	exports.minimum = minimum;
	function replicate(n, x) {
	    var result = new Array(n);
	    for (var i = 0; i < result.length; i++) {
	        result[i] = x;
	    }
	    return result;
	}
	exports.replicate = replicate;
	function take(n, xs) {
	    return xs.slice(0, n);
	}
	exports.take = take;
	function drop(n, xs) {
	    return xs.slice(n);
	}
	exports.drop = drop;
	function splitAt(n, xs) {
	    return [take(n, xs), drop(n, xs)];
	}
	exports.splitAt = splitAt;
	function takeWhile(f, xs) {
	    for (var i = 0; i < xs.length; i++) {
	        if (!f(xs[i])) {
	            return xs.slice(0, i);
	        }
	    }
	    return xs.slice();
	}
	exports.takeWhile = takeWhile;
	function dropWhile(f, xs) {
	    for (var i = 0; i < xs.length; i++) {
	        if (!f(xs[i])) {
	            return xs.slice(i);
	        }
	    }
	    return [];
	}
	exports.dropWhile = dropWhile;
	function group(xs) {
	    if (xs.length == 0) {
	        return [];
	    }
	    var result = [];
	    var last = [xs[0]];
	    for (var i = 1; i < xs.length; i++) {
	        if (last[0] === xs[i]) {
	            last.push(xs[i]);
	        }
	        else {
	            result.push(last);
	            last = [xs[i]];
	        }
	    }
	    result.push(last);
	    return result;
	}
	exports.group = group;
	function filter(f, xs) {
	    var result = [];
	    for (var i = 0; i < xs.length; i++) {
	        if (f(xs[i]))
	            result.push(xs[i]);
	    }
	    return result;
	}
	exports.filter = filter;
	function zip(xs, ys) {
	    var n = Prelude_1.min(xs.length, ys.length);
	    var result = new Array(n);
	    for (var i = 0; i < n; i++) {
	        result[i] = [xs[i], ys[i]];
	    }
	    return result;
	}
	exports.zip = zip;
	function unzip(xs) {
	    var r1 = new Array(xs.length);
	    var r2 = new Array(xs.length);
	    for (var i = 0; i < xs.length; i++) {
	        r1[i] = xs[i][0];
	        r2[i] = xs[i][1];
	    }
	    return [r1, r2];
	}
	exports.unzip = unzip;
	function range(from, to) {
	    var result = Array(to - from + 1);
	    for (var i = from; i <= to; i++) {
	        result[i - from] = i;
	    }
	    return result;
	}
	exports.range = range;
	function copy(xs) {
	    return xs.slice(0);
	}
	exports.copy = copy;
	function apply_permutation(p, xs) {
	    var n = xs.length;
	    var result = new Array(n);
	    for (var i = 0; i < n; i++) {
	        result[i] = xs[p[i]];
	    }
	    return result;
	}
	exports.apply_permutation = apply_permutation;
	function next_permutation(p) {
	    var n = p.length;
	    if (n < 2)
	        return null;
	    var r = copy(p);
	    var k = n - 2;
	    for (; k >= 0 && r[k] >= r[k + 1]; k--)
	        ;
	    if (k < 0)
	        return null;
	    for (var i = k + 1, j = n - 1; i < j; i++, j--) {
	        var t_1 = r[i];
	        r[i] = r[j];
	        r[j] = t_1;
	    }
	    var next = k + 1;
	    for (; r[next] <= r[k]; next++)
	        ;
	    var t = r[k];
	    r[k] = r[next];
	    r[next] = t;
	    return r;
	}
	exports.next_permutation = next_permutation;

/***/ },
/* 2 */
/***/ function(module, exports) {

	function min(a, b) {
	    return a < b ? a : b;
	}
	exports.min = min;
	function max(a, b) {
	    return a < b ? b : a;
	}
	exports.max = max;
	function curry(f) {
	    return function (x) { return function (y) { return f(x, y); }; };
	}
	exports.curry = curry;
	function uncurry(f) {
	    return function (x, y) { return f(x)(y); };
	}
	exports.uncurry = uncurry;
	function id(x) {
	    return x;
	}
	exports.id = id;
	function constant(x) {
	    return function (_) { return x; };
	}
	exports.constant = constant;
	function flip(f) {
	    return function (y) { return function (x) { return f(x)(y); }; };
	}
	exports.flip = flip;
	function flip2(f) {
	    return function (y, x) { return f(x, y); };
	}
	exports.flip2 = flip2;
	function compose(g, f) {
	    return function (x) { return g(f(x)); };
	}
	exports.compose = compose;

/***/ }
/******/ ]);

Array.prototype.sub_reverse = function(x,y) {
	var a = this;
	var n = a.length;
	for (var i = 0; i+i < (y - x); i++) {
		var temp = a[x+i];
		a[x+i] = a[y-1-i];
		a[y-1-i] = temp;
	}
}

Array.prototype.next_permutation = function(){
	var a = this;
	var n = a.length;
	if (n < 2) return false;

	//Find the largest index k such that a[k] < a[k + 1]. If no such index exists, the permutation is the last permutation.
	for (var k = n-2; k >= 0 && a[k] >= a[k+1]; --k){}
	if (k == -1) return false;

	//Find the largest index l greater than k such that a[k] < a[l].
	for (var l = n-1;  k < l && a[k] >= a[l]; --l){}
	if (k == l) return false;

	//Swap the value of a[k] with that of a[l].
	var temp = a[k];
	a[k] = a[l];
	a[l] = temp;

	//Reverse the sequence from a[k + 1] up to and including the final element a[n].
	a.sub_reverse(k+1,n);
	return true;
}

function solve(a) {
	var A = {x:a[0][0], y:a[0][1]};
	var B = {x:a[1][0], y:a[1][1]};
	var C = {x:a[2][0], y:a[2][1]};

	// line
	// AA
	// BB
	// CC
	if (A.x == B.x && B.x == C.x && A.x == (A.y + B.y + C.y) ) {
		write(A.x + "\n");
		for (var i = 0; i < A.y; i++) {
			for (var j = 0; j < A.x; j++)
				write("A");
			write("\n");
		}
		for (var i = 0; i < B.y; i++) {
			for (var j = 0; j < B.x; j++)
				write("B");
			write("\n");
		}
		for (var i = 0; i < C.y; i++) {
			for (var j = 0; j < C.x; j++)
				write("C");
			write("\n");
		}
		return true;
	}

	// ABB
	// ACC

	if (B.x == C.x && A.y == (B.y+C.y)) {
		write(A.y + "\n");
		for (var i = 0; i < B.y; i++) {
			for (var j = 0; j < A.x; j++) write("A");
			for (var j = 0; j < B.x; j++) write("B");
			write("\n");
		}
		for (var i = 0; i < C.y; i++) {
			for (var j = 0; j < A.x; j++) write("A");
			for (var j = 0; j < C.x; j++) write("C");
			write("\n");
		}
		return true;
	}
	return false;
}

function main() {
	a = readline().split(" ").map(Number);

	var order = [0,1,2];
	do {
		// 2d array
		var b = [];
		for (var i = 0; i < 3; i++) {
			b.push([ a[2*order[i]], a[2*order[i]+1] ]);
		}

		for (var rotation_mask = 0; rotation_mask < 8; rotation_mask++) {
			var c = [];
			// rotate
			for (var i = 0; i < 3; i++)
				if (rotation_mask & (1<<i)) {
					c[i] = b[i].slice(0).reverse();
				} else {
					c[i] = b[i].slice();
				}
			result = solve(c);
			if (result) break;
		}
		if (result) break;
	} while (order.next_permutation());

	if (!result) {
		write("-1\n");
	}
}

main();

Array.prototype.sub_reverse = function(x,y) {
	var a = this;
	var n = a.length;
	for (var i = 0; i+i < (y - x); i++) {
		var temp = a[x+i];
		a[x+i] = a[y-1-i];
		a[y-1-i] = temp;
	}
}

Array.prototype.next_permutation = function(){
	var a = this;
	var n = a.length;
	if (n < 2) return false;

	//Find the largest index k such that a[k] < a[k + 1]. If no such index exists, the permutation is the last permutation.
	for (var k = n-2; k >= 0 && a[k] >= a[k+1]; --k){}
	if (k == -1) return false;

	//Find the largest index l greater than k such that a[k] < a[l].
	for (var l = n-1;  k < l && a[k] >= a[l]; --l){}
	if (k == l) return false;

	//Swap the value of a[k] with that of a[l].
	var temp = a[k];
	a[k] = a[l];
	a[l] = temp;

	//Reverse the sequence from a[k + 1] up to and including the final element a[n].
	a.sub_reverse(k+1,n);
	return true;
}

function solve(a,order) {
	var letter = ["A","B","C"];
	var A = {x:a[0][0], y:a[0][1], letter:letter[order[0]]};
	var B = {x:a[1][0], y:a[1][1], letter:letter[order[1]]};
	var C = {x:a[2][0], y:a[2][1], letter:letter[order[2]]};

	// AA
	// BB
	// CC
	if (A.x == B.x && B.x == C.x && A.x == (A.y + B.y + C.y) ) {
		write(A.x + "\n");
		for (var i = 0; i < A.y; i++) {
			for (var j = 0; j < A.x; j++)
				write(A.letter);
			write("\n");
		}
		for (var i = 0; i < B.y; i++) {
			for (var j = 0; j < B.x; j++)
				write(B.letter);
			write("\n");
		}
		for (var i = 0; i < C.y; i++) {
			for (var j = 0; j < C.x; j++)
				write(C.letter);
			write("\n");
		}
		return true;
	}

	// ABB
	// ACC

	if (B.x == C.x && A.y == (B.y+C.y)) {
		write(A.y + "\n");
		for (var i = 0; i < B.y; i++) {
			for (var j = 0; j < A.x; j++) write(A.letter);
			for (var j = 0; j < B.x; j++) write(B.letter);
			write("\n");
		}
		for (var i = 0; i < C.y; i++) {
			for (var j = 0; j < A.x; j++) write(A.letter);
			for (var j = 0; j < C.x; j++) write(C.letter);
			write("\n");
		}
		return true;
	}
	return false;
}

function main() {
	a = readline().split(" ").map(Number);

	var order = [0,1,2];
	do {
		// 2d array
		var b = [];
		for (var i = 0; i < 3; i++) {
			b.push([ a[2*order[i]], a[2*order[i]+1] ]);
		}

		for (var rotation_mask = 0; rotation_mask < 8; rotation_mask++) {
			var c = [];
			// rotate
			for (var i = 0; i < 3; i++)
				if (rotation_mask & (1<<i)) {
					c[i] = b[i].slice(0).reverse();
				} else {
					c[i] = b[i].slice();
				}
			result = solve(c, order);
			if (result) break;
		}
		if (result) break;
	} while (order.next_permutation());

	if (!result) {
		write("-1\n");
	}
}

main();


const readline = require('readline');

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

var lineCount = 0
var testCount = 0
var outputStr = ''

rl.on('line', (input) => {
    if (lineCount == 0) {
        // first line
        testCount = parseInt(input)
    }
    else if (lineCount >= testCount) {
        outputStr += compute(input) + '\n'
        console.log(outputStr)
        rl.close()
    }
    else {
        // data
        outputStr += compute(input) + '\n'
    }
    lineCount++
});

function compute(str) {
    list = str.split(' ')
    var x = parseInt(list[0])
    var y = parseInt(list[1])
    var n = parseInt(list[2])
    var r = n % x

    if(r>=y){
        return (n - r + y)
    }
    else{
        return (n - r - x + y)
    }
}

let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStd) => {
  inputString += inputStd;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  let t = +readLine();
  while (t--) {
    let [x, y, n] = readLine()
      .split(" ")
      .map((num) => parseInt(num));

    if (n % x < y) {
      console.log(n - ((n % x) + (x - y)));
    } else if (n % x > y) {
      console.log(n - ((n % x) - y));
    } else {
      console.log(n);
    }
  }
}

//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = new Date();
  Main();
  var end = new Date() - start;

  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var t = nextInt();
	var output = new Array(t);
	for(var i = 0; i < t; i++){
		var one = nextIntArray();
		var x = one[0];
		var y = one[1];
		var n = one[2];
		if(n % x == y){
			output[i] = n;
		}else{
			if(n % x > y){
				output[i] = n - (n % x - y);
			}else{
				var tmp = y - (n % x);
				output[i] = n - x + tmp;
			}
		}
	}
	myout(myconv(output,9));
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let stdinInput = '';

process.stdin.on('data', input => {
  stdinInput += input;
});

process.stdin.on('end', () => {
  main(stdinInput);
});

function main(data) {
    data = data.split('\n');
    const testCases = data[0] * 1;
    let i = 1;
    while (i <= testCases) {
      let s = data[i].trim().split(' ');
      let x = +s[0];
      let y = +s[1];
      let n = +s[2];
      let mod = n % x;
      if (mod === y) {
        console.log(n);
        i += 1;
        continue;
      }
      if (mod > y) {
        console.log(n - (mod - y));
        i += 1;
        continue;
      }
      n -= mod;
      mod = n % x;
      n -= (x - y);
      console.log(n);
      i += 1;
    }
  }

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function main() {
    const testCases = parseInt(readline());
    function getAnswer(x, y, n) {
        const quotient = Math.floor(n / x);
        const remainder = n % x;
        var starting_cand = (quotient - 3) * x + y;
        while (starting_cand <= n) {
            starting_cand += x;
        }
        return starting_cand - x;
    }
    for (var tc=0; tc<testCases; tc++) {
        [a, b, c] = readline().split(" ").map(number => parseInt(number));
        console.log(getAnswer(a, b, c));
    }
}

var tc = Number(readline());
while(tc--)
{
	var arr = readline().split(' ').map(Number);
	var x = arr[0];
	var y = arr[1];
	var n = arr[2];
	n=n-y;
	print( Math.floor(n/x)*x + y );
}

function solve() {
   var xyn = read().split(' ').map(Number);
   var x = xyn[0], y = xyn[1], n = xyn[2];
   var z = n % x;
   var k = n + y - z;
   if (k > n) {
      k -= x;
   }
   write(k);
}

function init() {
   var T;
   T = 1;
   T = Number(read());
   for (var t = 0; t < T; t++) {
      solve();
   }
}

var isNode = typeof console !== 'undefined';
var MEMORY = [];
var MEMORY_INDEX = 0;
if (isNode) {
   var fs = require('fs');
   var path = require('path');

   var inTextName;
   var outTextName;
   if (process.argv.length === 5) {
      inTextName = process.argv[3];
      outTextName = process.argv[4];
   }

   if (inTextName) {
      fs.readFile(path.join(__dirname, inTextName), 'utf8', (err, data) => {
         MEMORY = data.split('\r\n');
         init();
      });
   } else {
      var RL = require('readline').createInterface({
         input : process.stdin,
         output : process.stdout
      });

      RL.on('line', (line) => {
         MEMORY.push(line);
      });

      RL.on('close', init);
   }
} else {
   init();
}

function write(value) {
   isNode ? console.log(value) : print(value);
}
function read() {
   return isNode ? MEMORY[MEMORY_INDEX++] : readline();
}

function solve(x,y,n) {
    var res = (Math.floor(n/x)*x)-(x-y);
    return res+x <= n ? res+x : res;
}
var t = Number(readline());
while (t--) {
    var arr = readline().split(' ').map(Number);
    var x = arr[0];
    var y = arr[1];
    var n = arr[2];
    print(solve(x,y,n));
}


const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    // const n = yield* binarySearch(3n, 5n)
    for (let i = 1; i <= 25; i++) {
        const a = yield* ask(1, i + 1)
        const b = yield* ask(i + 1, 1)
        if (a === '-1') {
            return answer(i)
        } else if (a !== b) {
            return answer(BigInt(a) + BigInt(b))
        }
    }
}
function answer(n) {
    console.log('! ' + n)
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return r
}

const readline = require('readline');
const { stdin: input, stdout: output } = require('process');

const rl = readline.createInterface({ input, output });

let i = 0, j = 1, a1 = 0, a2 = 0

const question = () => {
  if (i & 1) {
    console.log(`? ${j} ${j + 1}`)
  } else {
    console.log(`? ${j + 1} ${j}`)
  }
}
question()
rl.on('line', line => {
  if (i & 1) {
    a2 = BigInt(line)
    if(a1===-1||a2===-1){
      console.log(`! ${j-1}`)
      return
    }
    if (a1 !== a2) {
      console.log(`! ${a1 + a2}`)
      return
    }
    j++
  } else {
    a1 = BigInt(line)
  }
  i++
  question()
})

const readline = require('readline');
const { stdin: input, stdout: output } = require('process');

const rl = readline.createInterface({ input, output });

let i = 0, j = 1, a1 = 0, a2 = 0

const question = () => {
  if (i & 1) {
    console.log(`? ${j} ${j + 1}`)
  } else {
    console.log(`? ${j + 1} ${j}`)
  }
}
question()
rl.on('line', line => {
  if (i & 1) {
    a2 = Number(line)
    if(a1===-1||a2===-1){
      console.log(`! ${j-1}`)
      return
    }
    if (a1 !== a2) {
      console.log(`! ${a1 + a2}`)
      return
    }
    j++
  } else {
    a1 = Number(line)
  }
  i++
  question()
})

const readline = require('readline');
const { stdin: input, stdout: output } = require('process');

const rl = readline.createInterface({ input, output });

let i = 0, j = 1, a1 = 0, a2 = 0

const question = () => {
  if (i & 1) {
    console.log(`? ${j} ${j + 1}`)
  } else {
    console.log(`? ${j + 1} ${j}`)
  }
}
question()
rl.on('line', line => {
  if (i & 1) {
    a2 = Number(line)
    if (a1 !== a2) {
      console.log(`! ${a1 + a2}`)
      return
    }
    j++
  } else {
    a1 = Number(line)
    if (a1 === -1) {
      console.log(`! ${j-1}`)
      return
    }
  }
  i++
  question()
})

const readline = require('readline');
const { stdin: input, stdout: output } = require('process');

const rl = readline.createInterface({ input, output });

let i = 0, j = 1, a1 = 0, a2 = 0

const question = () => {
  if (i & 1) {
    console.log(`? ${j} ${j + 1}`)
  } else {
    console.log(`? ${j + 1} ${j}`)
  }
}
question()
rl.on('line', line => {
  if (i & 1) {
    a2 = Number(line)
    if (a1 !== a2) {
      console.log(`! ${a1 + a2}`)
      return
    }
    j++
  } else {
    a1 = Number(line)
    if (a1 === -1) {
      console.log(`! ${j}`)
      return
    }
  }
  i++
  question()
})

const readline = require('readline');
const { stdin: input, stdout: output } = require('process');

const rl = readline.createInterface({ input, output });

let i = 0, j = 1, a1 = 0, a2 = 0

const question = () => {
  if (i & 1) {
    console.log(`? ${j} ${j + 1}`)
  } else {
    console.log(`? ${j + 1} ${j}`)
  }
}
question()
rl.on('line', line => {
  if (i & 1) {
    a2 = Number(line)
    if (a1 !== a2) {
      console.log(a1 + a2)
      return
    }
    j++
  } else {
    a1 = Number(line)
    if (a1 === -1) {
      console.log(j)
      return
    }
  }
  i++
  question()
})

const readline = require('readline');
const { stdin: input, stdout: output } = require('process');

const rl = readline.createInterface({ input, output });

let i = 2, j = 1

const question = () => {
  console.log(`? ${i} ${j}`)
}
question()
rl.on('line', line => {
  const a = Number(line)
  if (a === -1) {
    console.log(`! ${i - 1}`)
  } else if (a !== i - j) {
    console.log(`! ${a + i - j}`)
  } else {
    if (j + 1 < i) j++
    else i++
    question()
  }
})

const readline = require('readline');
const { stdin: input, stdout: output } = require('process');

const rl = readline.createInterface({ input, output });

let i = 1

const question = () => {
  console.log(`? ${i} ${i + 1}`)
}
question()
rl.on('line', line => {
  const a = Number(line)
  if (a === -1) {
    console.log(`! ${i - 1}`)
  } else if (a !== 1) {
    console.log(`! ${a + 1}`)
  } else {
    i++
    question()
  }
})

const readline=require('readline')
const rl = readline.createInterface({input:process.stdin,output:process.stdout})

void async function main(){
for(let i=2;i<=50;i++){
 for(let j=1;j<i;j++){
 const d=i-j
 let ans=Number(await rl.question(`? ${j} ${i}`))
 if(ans!==d){
  console.log('! '+ans+d)
  return
 }
 ans=Number(await rl.question(`? ${i} ${j}`))
 if(ans!==d){
  console.log('! '+ans+d)
  return
 }
}
}
}()

const readline=require('readline')
const rl = readline.createInterface({input:process.stdin,output:process.stdout})

void async function main(){
for(let i=2;i<=50;i++){
 for(let j=1;j<i;j++){
 const d=i-j
 let ans=Number(await rl.question(`? ${j} ${i}`))
 if(ans!==d){
  console.log(ans+d)
  return
 }
 ans=Number(await rl.question(`? ${i} ${j}`))
 if(ans!==d){
  console.log(ans+d)
  return
 }
}
}
}()

const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    const log = []
    for (let i = 1; i <= 25; i++) {
        const u = rn(i + 1)
        const a = yield* ask(u, i + 3)
        const b = yield* ask(i + 3, u)
        if (a < 0 || b < 0) {
            return answer(i + 2)
        } else if (a !== b) {
            return answer(a + b)
        }
        log.push([u, i + 3, a, b].join(' '))
    }
    throw log.join(';')
}
function rn(n) {
    return Math.floor(Math.random() * n) + 1
}
function answer(n) {
    console.log('! ' + n)
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return +r
}

const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    for (let i = 1; i <= 25; i++) {
        const u = rn(i + 2)
        const a = yield* ask(u, i + 3)
        const b = yield* ask(i + 3, u)
        if (a < 0 || b < 0) {
            return answer(i + 2)
        } else if (a !== b) {
            return answer(a + b)
        }
    }
}
function rn(n) {
    return Math.floor(Math.random() * n) + 1
}
function answer(n) {
    console.log('! ' + n)
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return +r
}

const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    for (let i = 1; i <= 25; i++) {
        const a = yield* ask(1, i + 3)
        const b = yield* ask(i + 3, 1)
        if (a < 0 || b < 0) {
            return answer(i + 2)
        } else if (a !== b) {
            return answer(a + b)
        }
    }
}
function answer(n) {
    console.log('! ' + n)
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return +r
}

const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    // hash v2
    // const n = yield* binarySearch(3n, 5n)
    for (let i = 1; i <= 25; i++) {
        const a = yield* ask(3, i + 3)
        const b = yield* ask(i + 3, 3)
        if (a < 0 || b < 0) {
            return answer(i + 2)
        } else if (a !== b) {
            return answer(a + b)
        }
    }
}
function answer(n) {
    console.log('! ' + n)
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return +r
}

const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    // hash v2
    // const n = yield* binarySearch(3n, 5n)
    for (let i = 1; i <= 25; i++) {
        const a = yield* ask(2, i + 1)
        const b = yield* ask(i + 1, 2)
        if (a < 0 || b < 0) {
            return answer(i)
        } else if (a !== b) {
            return answer(a + b)
        }
    }
}
function answer(n) {
    console.log('! ' + n)
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return +r
}

const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    // hash v2
    // const n = yield* binarySearch(3n, 5n)
    for (let i = 1; i <= 25; i++) {
        const a = yield* ask(1, i + 1)
        const b = yield* ask(i + 1, 1)
        if (a < 0 || b < 0) {
            return answer(i)
        } else if (a !== b) {
            return answer(a + b)
        }
    }
}
function answer(n) {
    console.log('! ' + n)
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return +r
}

const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    // const n = yield* binarySearch(3n, 5n)
    for (let i = 1; i <= 25; i++) {
        const a = yield* ask(1, i + 1)
        const b = yield* ask(i + 1, 1)
        if (a < 0 || b < 0) {
            return answer(i)
        } else if (a !== b) {
            return answer(a + b)
        }
    }
}
function answer(n) {
    console.log('! ' + n)
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return +r
}

const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    // const n = yield* binarySearch(3n, 5n)
    const n = yield* binarySearch(3n, BigInt(1e9) * BigInt(1e9))
    console.log(`! ${n}`)
}
function* binarySearch(l, r) {
    while (l <= r) {
        const m = l + ((r - l) / 4n)
        const ok = (yield* ask(1, m)) > 0
        if (ok) {
            l = m + 1n
        } else {
            r = m - 1n
        }
    }
    return r
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return +r
}

const readline = require('readline');

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

const g = main();
g.next()
rl.on('line', (input) => {
    // console.log('read', input)
    input.split('\n').forEach(s => s.trim() && g.next(s))
});

function* main() {
    let input

    // input = yield 1
    const t = 1//+input
    for (let i = 0; i < t; i++) {
        // input = yield 1
        yield* solve()
    }
    process.exit(0)
}

function* solve() {
    // const n = yield* binarySearch(3n, 5n)
    const n = yield* binarySearch(3n, BigInt(1e9) * BigInt(1e9))
    console.log(`! ${n}`)
}
function* binarySearch(l, r) {
    while (l <= r) {
        const m = l + ((r - l) / 3n)
        const ok = (yield* ask(1, m)) > 0
        if (ok) {
            l = m + 1n
        } else {
            r = m - 1n
        }
    }
    return r
}
function* ask(a, b) {
    console.log(`? ${a} ${b}`)
    const r = yield 1
    return +r
}


let fs=require('fs');
let txt=fs.readFileSync(0,"utf-8").split(/[\n\r]/).filter(data=>data.length>0);

txt.forEach(data=>{
    doit(data*1);
});

function doit(data){
    let score=0;
    for (let index = data; index >0; index--) {
        score+=1/index;
    }
    console.log(score);
}

var val = readline().split(' ').map((val)=>{
    return parseInt(val);
})
var sum = 0;
for(var i = 0 ;i < val ;i++){
  sum += 1/(1+i);
}
print(sum);

var n = parseInt(readline(), 10),
    sum = 0;

for(var i=1; i<=n; i++) {
    sum += 1/i;
}

print(sum);

var n = readline().split(' ');
var ans = 0;
for(var k = 1; k <= n; k++) {
  ans += 1/k;
}
print(ans);

var num_oponents = readline();
var earns = [];
for (var t = 0; t < num_oponents; t++) {
  earns.push(1 / (num_oponents - t));
}
var sum = 0;
for(var i=0;i<earns.length;i++){
	sum = sum+earns[i];
}
print(sum);

process.stdin.resume()
process.stdin.setEncoding('utf-8')

var arr = ''
process.stdin.on('data', (i) => {
  arr += i
})

process.stdin.on('end', () => {
  arr = arr.split('\n').map(a => a.replace(/(\r\n|\n|\r)/gm, ''))
  main(arr)
})

function wr(...x) {
  console.log(...x)
}

function sort(a, inc = true) {
  if(inc) a.sort((a, b) => a - b)
  else a.sort((a, b) => b - a)
}

function readInt(a, i) {
  if(i === undefined) return parseInt(a.shift())
  else return parseInt(a[i])
}

function readInts(a, i) {
  if(i === undefined) return arr.shift().split(' ').map(a => parseInt(a))
  else return arr[i].split(' ').map(a => parseInt(a))
}

function main(input) {
  const n = readInt(input)

  let sum = 0
  for(let i = 1; i <= n; i++) {
    sum += (1 / i)
  }

  wr(sum)
}

var n = readline().split(' ');
var arr = 0;
for(var k = 1; k <= n; k++) {
  arr += 1/k;
}
print(k);


let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL);

    function foo (a, b, c) {
        for (let i = 0; i<a.length; i++) {
            if (c[i] !== a[i] && c[i] !== b[i]) return 'NO';
        }
        return 'YES'
    }

    let testCount = 1;
    let answer = '';
    while(testCount <= +lines[0]) {
        let a = lines[testCount * 3 - 2].split('');
        let b = lines[testCount * 3 - 1].split('');
        let c = lines[testCount * 3].split('');

        let result = foo(a, b, c);
        answer += result +"\n";
        testCount++;
    }
    console.log(answer);
})

var tests= readline();

for(var n=0;n<tests;n++){
    //print(`n: ${n} tests:${tests}`)
    var res="YES";
    var a = readline();
    var b = readline();
    var c = readline();
    for(var i=0;i<a.length;i++){
        if(a[i]===c[i]||b[i]===c[i]){continue;}
        res="NO";break;
    }//go through each character of str a

    print(res);
}//tests loop

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す
//6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main() {
  var t = myconv(next(),1);
  var output = new Array(t);
  for(var i = 0; i < t; i++){
      var a = myconv(next(),6);
      var b = myconv(next(),6);
      var c = myconv(next(),6);
      var isNG = false;
      for(var j = 0; j < a.length; j++){
          if((a[j] != b[j] && (a[j] == c[j] || b[j] == c[j])) || (a[j] == c[j] && a[j] == b[j])){

          }else{
              isNG = true;
              break;
          }
      }
      if(isNG){
          output[i] = "NO";
      }else{
          output[i] = "YES";
      }

  }
  myout(myconv(output,9));
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;
let arr = [];

rl.on('line', (str) => {
  if (c === 0) {
    c++;
    return;
  }

  if (c % 3 !== 0) {
    arr.push(str);
    c++;
    return;
  }

  let r = 'YES';
  for (let j = 0; j < arr[0].length; j++) {
    if (arr[0][j] !== str[j] && arr[1][j] !== str[j]) {
      r = 'NO';
      break;
    }
  }

  arr = [];
  console.log(r);

  c++;
});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
    let t = readline();

    while(t--)
    {
        let a = readline();
        let b = readline();
        let c = readline();
        let cnt = 0;

        for(let i = 0;i<a.length;i++)
        {
           if(c[i]==a[i]||c[i]==b[i]) cnt++;
        }

        if(cnt==a.length) console.log("YES");
        else console.log("NO");
    }

}

const processData = (lines) => {
  const num = +lines[0]

  for (let j=0; j<num; j++){
    const [a, b, c] = [lines[j*3+1], lines[j*3+2], lines[j*3+3]]
    let isOk = true
    for (let i = 0; i<c.length; i++) {
      if (c[i] === a[i] || c[i] === b[i]) {

      } else {
        isOk = false
        break;
      }
    }
    console.log(isOk ? 'YES' : 'NO')
  }
}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
  const {EOL} = require('os')
  const lines = i.split(EOL) /*your input text, split by lines*/
  processData(lines)
})

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す
//6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main() {
  var t = myconv(next(),1);
  var output = new Array(t);
  for(var i = 0; i < t; i++){
      var a = myconv(next(),6);
      var b = myconv(next(),6);
      var c = myconv(next(),6);
      var isNG = false;
      for(var j = 0; j < a.length; j++){
          if(a[j] != b[j] && (a[j] == c[j] || b[j] == c[j])){

          }else{
              isNG = true;
              break;
          }
      }
      if(isNG){
          output[i] = "NO";
      }else{
          output[i] = "YES";
      }

  }
  myout(myconv(output,9));
}


var n = Number(readline());

var inp ;

for (var i = 0; i < n ; i++){
    inp = readline().split(' ').map(cur => Number(cur));
    var gl = (inp[1] - inp [2])*inp[0];
    var gu = (inp[1] + inp [2])*inp[0];
    var bl = inp[3] - inp [4];
    var bu = inp[3] + inp [4];

((gu >= bu || (gu <= bu && gu >= bl)) && (gl <= bl || (gl <= bu && gl >= bl)))?print("YES"):print("NO");

}

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す
//6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
//atcoderのサンプルは最後に改行入れること
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main() {
    var t = nextInt();
	var output = new Array(t);
	for(var i = 0; i < t; i++){
		var tmp = nextIntArray();
		var n = tmp[0];
		var a = tmp[1];
		var b = tmp[2];
		var c = tmp[3];
		var d = tmp[4];
		var singleMin = (a - b) * n;
		var singleMax = (a + b) * n;
		var packMin = c - d;
		var packMax = c + d;
		if(singleMin > packMax){
			output[i] = "NO";
		}else if(singleMax < packMin){
			output[i] = "NO";
		}else{
			output[i] = "YES";
		}
	}
	myout(myconv(output,9));
}

// your code goes here
var tst;
tst = parseInt(readline());

for(var tc = 0; tc < tst; tc++)
{
    var input = readline().split(" ");
    var n = parseInt(input[0]);
    var a = parseInt(input[1]);
    var b = parseInt(input[2]);
    var c = parseInt(input[3]);
    var d = parseInt(input[4]);
    var minGrainWeight = a - b;
    var maxGrainWeight = a + b;
    var minTotalWeight = c - d;
    var maxTotalWeight = c + d;
    if(maxGrainWeight * n < minTotalWeight ||
        minGrainWeight * n > maxTotalWeight) print("No");
    else print("Yes");
}

var t = parseInt(readline());

function mapper(s) { return +s; }

for(var qq = 0; qq < t; qq++) {
    var line = readline().split(' ').map(mapper);
    var n = line[0];
    var a = line[1];
    var b = line[2];
    var c = line[3];
    var d = line[4];

    var minW = a - b;
    var maxW = a + b;

    var minC = c - d;
    var maxC = c + d;

    if (maxW * n < minC || minW * n > maxC) {
        print('No');
    } else {
        print('Yes');
    }
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let count = 0;

rl.on('line', (data) => {
  if (count === 0) {
    count++;
    return;
  }

  let [n, a, b, c, d] = data.split(' ').map(Number);
  let x = (a - b) * n;
  let y = (a + b) * n;

  if ( (x >= c - d || y >= c - d) && (x <= c + d || y <= c + d) ) {
    console.log('YES');
  }
  else {
    console.log('NO');
  }

  count++;
});

// Lang: Node.js
'use strict';
let x = '', y = 0;
let print = x => console.log(x);

process.stdin.on('data', inputStdin => x += inputStdin);
process.stdin.on('end', () => { x = x.split('\n'); main(); });
let readline = () => x[y++];

// ************************ Code Start ***************************

function main() {

 var Tc = parseInt(readline());
  while (Tc--) {
    var ar1 = readline().split(" ").map((x) => parseInt(x));
    var n = ar1[0], a = ar1[1], b = ar1[2], c = ar1[3], d = ar1[4];
    if ((a - b) * n > c + d || (a + b) * n < c - d) print("NO");
    else print("YES");
  }
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function main() {
    var range = readline();
    for(let r=0;r<range;r++) {
        var data = readline().split(" ").map(x => parseInt(x));
        var n = data[0];
        var x1 = data[1] - data[2];
        var x2 = data[1] + data[2];
        var y1 = data[3] + data[4];
        var y2 = data[3] - data[4];

        if(n * x1 > y1 || n * x2 < y2) {
            console.log("No");
        } else {
            console.log("Yes");
        }

    }

}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length - 1; i++) {
        let thing = lines[i]
        let args = thing.split(" ").map(parseFloat)
        console.log(nastya(args[0], args[1], args[2], args[3], args[4]))
    }

})

function nastya(n, a, b, c, d) {
    const iWeightLowerBound = (a - b) * n
    const iWeightUpperBound = (a + b) * n

    const totalWeightUpperBound = c + d
    const totalWeightLowerBound = c - d

    if ((totalWeightUpperBound < iWeightLowerBound) || (iWeightUpperBound < totalWeightLowerBound)) {
        return "No";
    }

    return "Yes";

}

var t = parseInt(readline());
for (var tc = 0; tc < t; tc++) {
  var input = readline().split(" ");
  var n = parseInt(input[0]);
  var a = parseInt(input[1]);
  var b = parseInt(input[2]);
  var c = parseInt(input[3]);
  var d = parseInt(input[4]);
  var minGrainWeight = a - b;
  var maxGrainWeight = a + b;
  var minTotalWeight = c - d;
  var maxTotalWeight = c + d;

  if (
    maxGrainWeight * n < minTotalWeight ||
    minGrainWeight * n > maxTotalWeight
  ) {
    print("No");
  } else print("Yes");
}

var t = parseInt(readline());
for (var tc = 0; tc < t; tc++) {
  var n = parseInt(readline());
  var a = parseInt(readline());
  var b = parseInt(readline());
  var c = parseInt(readline());
  var d = parseInt(readline());
  var minGrainWeight = a - b;
  var maxGrainWeight = a + b;
  var minTotalWeight = c - d;
  var maxTotalWeight = c + d;
  var result = "Yes";
  if (
    maxGrainWeight * n < minTotalWeight ||
    minGrainWeight * n > maxTotalWeight
  )
    result = "No";
  print(result);
}

var t = parseInt(readline());
for (var tc = 0; tc < t; tc++) {
  var n = parseInt(readline());
  var a = parseInt(readline());
  var b = parseInt(readline());
  var c = parseInt(readline());
  var d = parseInt(readline());
  var mingrainWeight = a - b;
  var maxGrainWeight = a + b;
  var minTotalWeight = c - d;
  var maxTotalWeight = c + d;
  var result = "No";
  for (var i = mingrainWeight; i <= maxGrainWeight; i++) {
    if (i * n >= minTotalWeight && i <= maxTotalWeight) {
      result = "Yes";
      break;
    }
  }
  print(result);
}

var t = parseInt(readline());
for (var tc = 0; tc < t; tc++) {
  var n = parseInt(readline());
  var a = parseInt(readline());
  var b = parseInt(readline());
  var c = parseInt(readline());
  var d = parseInt(readline());
  var minGrainWeight = a - b;
  var maxGrainWeight = a + b;
  var minTotalWeight = c - d;
  var maxTotalWeight = c + d;

  if (
    maxGrainWeight * n < minTotalWeight ||
    minGrainWeight * n > maxTotalWeight
  ) {
    print("No");
  } else print("Yes");
}

var t = parseInt(readline());
for (var tc = 0; tc < t; tc++) {
  var n = parseInt(readline());
  var a = parseInt(readline());
  var b = parseInt(readline());
  var c = parseInt(readline());
  var d = parseInt(readline());
  var minGrainWeight = a - b;
  var maxGrainWeight = a + b;
  var minTotalWeight = c - d;
  var maxTotalWeight = c + d;
  var result = "Yes";
  if (
    maxGrainWeight * n < minTotalWeight ||
    minGrainWeight * n > maxTotalWeight
  ) {
    result = "No";
  }
  print(result);
}

var t = parseInt(readline());
for (var tc = 0; i < t; tc++) {
  var n = parseInt(readline());
  var a = parseInt(readline());
  var b = parseInt(readline());
  var c = parseInt(readline());
  var d = parseInt(readline());
  var mingrainWeight = a - b;
  var maxGrainWeight = a + b;
  var minTotalWeight = c - d;
  var maxTotalWeight = c + d;
  var result = "No";
  for (var i = mingrainWeight; i <= maxGrainWeight; i++) {
    if (i * n >= minTotalWeight && i <= maxTotalWeight) {
      result = "Yes";
      break;
    }
  }
  print(result);
}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length - 1; i++) {
        let thing = lines[i]
        let args = thing.split(" ").map(parseFloat)
        console.log(nastya(args))
    }

})

function nastya(n, a, b, c, d) {
    const iWeightLowerBound = (a - b) * n
    const iWeightUpperBound = (a + b) * n

    const totalWeightUpperBound = c + d
    const totalWeightLowerBound = c - d

    if ((totalWeightUpperBound < iWeightLowerBound) || (iWeightUpperBound < totalWeightLowerBound)) {
        return "No";
    }

    return "Yes";

}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length; i++) {
        let thing = lines[i]
        console.log(thing.split(" "))
    }

})

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length - 1; i++) {
        let thing = lines[i]
        let args = thing.split(" ").map(parseFloat)
        console.log(nastya(args), args)
    }

})

function nastya(n, a, b, c, d) {
    var iWeightLowerBound = (a - b) * n
    var iWeightUpperBound = (a + b) * n

    var totalWeightUpperBound = c + d
    var totalWeightLowerBound = c - d

    if ((totalWeightUpperBound < iWeightLowerBound) || (iWeightUpperBound < totalWeightLowerBound)) {
        return "No";
    }

    return "Yes";

}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length; i++) {
        console.log("lines[i]")
    }

})

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length - 1; i++) {
        let thing = lines[i]
        let args = thing.split(" ").map(parseFloat)
        console.log(nastya(args), args)
    }

})

function nastya(n, a, b, c, d) {
    const iWeightLowerBound = (a - b) * n
    const iWeightUpperBound = (a + b) * n

    const totalWeightUpperBound = c + d
    const totalWeightLowerBound = c - d

    if ((totalWeightUpperBound < iWeightLowerBound) || (iWeightUpperBound < totalWeightLowerBound)) {
        return "No";
    }

    return "Yes";

}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length - 1; i++) {
        let thing = lines[i]
        console.log(nastya(thing.split(" ").map(parseFloat)))
    }

})

function nastya(n, a, b, c, d) {
    var iWeightLowerBound = (a - b) * n
    var iWeightUpperBound = (a + b) * n

    var totalWeightUpperBound = c + d
    var totalWeightLowerBound = c - d

    if ((totalWeightUpperBound < iWeightLowerBound) || (iWeightUpperBound < totalWeightLowerBound)) {
        return false;
    }

    return true;

}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/
    console.log("hello", lines);

    console.log(lines[0])

})

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length; i++) {
        let thing = lines[i]
        console.log(thing.split(" ").map(parseFloat))
    }

})

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length - 1; i++) {
        let thing = lines[i]
        console.log(nastya(thing.split(" ").map(parseFloat)))
    }

})

function nastya(n, a, b, c, d) {
    var iWeightLowerBound = (a - b) * n
    var iWeightUpperBound = (a + b) * n

    var totalWeightUpperBound = c + d
    var totalWeightLowerBound = c - d

    if ((totalWeightUpperBound < iWeightLowerBound) || (iWeightUpperBound < totalWeightLowerBound)) {
        return "NO";
    }

    return "YES";

}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/
    console.log("hello", lines);
})

function nastya(n, a, b, c, d) {
    var iWeightLowerBound = (a - b) * n
    var iWeightUpperBound = (a + b) * n

    var totalWeightUpperBound = c + d
    var totalWeightLowerBound = c - d

    if ((totalWeightUpperBound < iWeightLowerBound) || (iWeightUpperBound < totalWeightLowerBound)) {
        return false;
    }

    return true;

}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    for (let i = 1; i < lines.length; i++) {
        let thing = lines[i]
        console.log(thing.split(" ").map(parseInt))
    }

})

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    console.log(nastya(11, 11, 10, 234, 2))
    for (let i = 1; i < lines.length - 1; i++) {
        let thing = lines[i]
        let args = thing.split(" ").map(parseFloat)
        console.log(nastya(args))
    }

})

function nastya(n, a, b, c, d) {
    const iWeightLowerBound = (a - b) * n
    const iWeightUpperBound = (a + b) * n

    const totalWeightUpperBound = c + d
    const totalWeightLowerBound = c - d

    if ((totalWeightUpperBound < iWeightLowerBound) || (iWeightUpperBound < totalWeightLowerBound)) {
        return "No";
    }

    return "Yes";

}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function main() {
    var range = readline();
    for(let r=0;r<range;r++) {
        var data = readline().split(" ").map(x => parseInt(x));

        var x1 = data[1] - data[2];
        var x2 = data[1] + data[2];
        var y1 = data[3] + data[4];
        var y2 = data[3] - data[4];

        if(Math.floor(y1/x1) === data[0]) {
            console.log("Yes");
        } else if(Math.ceil(y2/x2) === data[0]) {
            console.log("Yes");
        } else {
            console.log("No");
        }

    }

}


var inp = +readline(), ip, count, i, ans, x;

while (inp > 0) {
    inp--;
    ip = readline();
    count = ip === "::" ? 0 : ip.replace(/^::|::$/g, "").split(/::?/g).length;

    if (count < 8) {
        ip = ip.replace("::", function() {
            var ins = ":";
            for (i = 0; i < 8 - count; i++) {
                ins += "0000:";
            }
            return ins;
        });
        ip = ip.replace(/^:/, "").replace(/:$/, "");
    }

    ip = ip.split(":");
    ans = "";
    for (x in ip) {
        y = ip[x];
        while (y.length < 4) y = "0" + y;
        ans += y + ":";
    }
    print(ans.substring(0, ans.length - 1));
}

var addressCount = Number(readline());
while (addressCount--) {
  var parts = readline().split(":");
  if (!parts[0].length) parts.shift();
  if (!parts[parts.length - 1].length) parts.pop();
  var index = parts.indexOf("");
  if (index != -1) parts.splice(index, 1, ...new Array(9 - parts.length).fill("0000"));
  print(parts.map(x => "0".repeat(4 - x.length) + x).join(":"));
}

var n = Number(readline());
while (n--) {
    var str = readline();
    var arr = str.split(':');
    var result = '';
    var flag = false;
    for (var i = 0; i < arr.length; i++) {
        if (arr[i].length === 0 && !flag) {
            for (var j = 0; j < 9 - arr.length; j++) result += '0000:';
            flag = true;
        } else {
            if (arr[i].length === 4) result += ((arr[i]) + ':');
            else if (arr[i].length === 3) result += ('0' + arr[i]+':');
            else if (arr[i].length === 2) result += ('00' + arr[i]+':');
            else if (arr[i].length === 1) result += ('000' + arr[i]+':');
            else if (arr[i].length === 0) result += ('0000:');
        }
    }
    write(result.substr(0,result.length - 1)+'\n');
}


let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}

// utils
const MOD = 1e9 + 7;
const mod = (n) => ((n % MOD) + MOD) % MOD;
const add = (a, b) => mod(mod(a) + mod(b));
const sub = (a, b) => mod(mod(a) - mod(b));
function mul() {
  for (var a = arguments, r = a[0], i = a.length; --i; )
    r = ((((r >> 16) * a[i]) % MOD) * 65536 + (r & 65535) * a[i]) % MOD;
  return r;
}
function inv(b) {
  for (var a = MOD, u = 0, v = 1, t; b; v = t)
    (t = (a / b) | 0), (a -= t * b), (u -= t * v), (t = a), (a = b), (b = t), (t = u), (u = v);
  u %= MOD;
  return u < 0 ? u + MOD : u;
}
function pow(base, n) {
  if (n === 0) return 1;
  let p = pow(base, Math.floor(n / 2));
  let res = mul(mod(p), mod(p));
  if (n % 2 === 1) res = mul(mod(res), base);
  return res;
}
function highestOneBit(i) {
  i |= i >> 1;
  i |= i >> 2;
  i |= i >> 4;
  i |= i >> 8;
  i |= i >> 16;
  return i - (i >>> 1);
}
function permutation(arr, len, store = "", permutations = []) {
  if (store.length === len) {
    permutations.push(store);
    return;
  }
  for (let i = 0; i < arr.length; i++) {
    const newArr = [...arr];
    const newChar = newArr.splice(i, 1);
    permutation(newArr, len, store.concat(newChar), permutations);
  }
  return permutations;
}

function main() {
  const str1 = readLine();
  const str2 = readLine();
  let count = 0;

  const r1 = str1.split("").sort().join("");
  const r2 = str2.split("").sort().join("");

  if (r1 === r2) {
    for (let i = 0; i < str1.length; i++) {
      const [char1, char2] = [str1[i], str2[i]];
      if (char1 !== char2) count++;
    }
    if (count === 2) {
      console.log("YES");
    } else {
      console.log("NO");
    }
  } else console.log("NO");
}

first = readline();
second = readline();
i = -1;
var pos = -1;
var flag = undefined;

if (first.length != second.length) print('NO');
else {
    while (++i < first.length) {
        if (first[i] != second[i] && flag !== undefined) { flag = false; break; }
        if (first[i] != second[i] && pos === -1) pos = i;
        else if (first[i] != second[i] && pos > -1) {
            flag = (first[i] == second[pos] && second[i] == first[pos]);
            if (!flag) break;
        }
    }
    print(flag ? 'YES' : 'NO');
}


var i, lb = [], counter = 0, max = [0], input = readline().split('');

function update(){
    if (counter > max[0]) {
        max = [counter];
    } else if (counter && counter == max[0]) {
        max.push(counter);
    }
    counter = 0;
}

for (i = 0; i < input.length; i++){
    if (input[i] === '(') {
        lb.push(i);
    } else {
        if (lb.length) {
            input[i] = '.';
            input[lb.pop()] = '.';
        }
    }
}

for (i = 0; i < input.length; i++){
    if (input[i] === '.'){
        counter++;
    } else {
        update();
    }
}

if (counter) update();

print(max[0] + ' ' + max.length);

var i, j, lb = [], counter = 0, max = [0], input = readline().split('');

function update(){
    if (counter > max[0]) {
        max = [counter];
    } else if (counter && counter == max[0]) {
        max.push(counter);
    }
    counter = 0;
}

for (i=0; i<input.length; i++){
    if (input[i] === '(') {
        lb.push(i);
    } else if (input[i] === ')') {
        if (lb.length) {
            input[i] = '.';
            input[lb.pop()] = '.';
        }
    }
}

for (i=0; i<input.length; i++){
    if (input[i] === '.'){
        counter++;
    } else {
        update();
    }
}

if (counter) update();

print(max[0] + ' ' + max.length);

var line = readline();

var l = 0;
var la=[];
var max = 0;
var c = 0;
for(var i=0;i<line.length;i++){
	if(line[i] == '('){
		if( la[l] === undefined){
			la[l]=i;
		}
		l++;
	}else{
		l--;
		if(l>=0){
			var j = i-la[l]+1;
			if( j > max){
				max = j;
				c=1;
			}else if( j==max){
				c++;
			}
		}
		for(var k=l+1; la[k]!==undefined; k++){
			la[k]=undefined;
		}
	}
	if(l<0){
		l=0;
		la=[];
	}
}

if(max==0){
	c=1;
}
print(max+' '+c);

var line = readline();

var l = 0;
var la=[];
var max = 0;
var c = 0;
for(var i=0;i<line.length;i++){
	if(line[i] == '('){
		if( la[l] === undefined){
			la[l]=i;
		}
		l++;
	}else{
		l--;
		if(l>=0){
			var j = i-la[l]+1;
			if( j > max){
				max = j;
				c=1;
			}else if( j==max){
				c++;
			}
		}
		la[l+1] = undefined;
	}
	if(l<0){
		l=0;
		la=[];
	}
}

if(max==0){
	c=1;
}
print(max+' '+c);

// Generated by CoffeeScript 1.4.0
(function() {
  var c, i, istack, len, match, max_count, max_len, min_i, mlp, s;

  s = readline();

  match = new Array(s.length);

  max_len = 0;

  max_count = 0;

  istack = [];

  for (i in s) {
    c = s[i];
    if (c === '(') {
      istack.push(+i);
    } else if (istack.length > 0) {
      mlp = istack.pop();
      min_i = match[mlp - 1] != null ? match[mlp - 1] : mlp;
      match[+i] = min_i;
      len = +i - min_i + 1;
      if (len > max_len) {
        max_len = len;
        max_count = 1;
      } else if (len === max_len) {
        max_count++;
      }
    }
  }

  if (max_count === 0) {
    print("0 1");
  } else {
    print(max_len + ' ' + max_count);
  }

}).call(this);

var line = readline();

var l = 0;
var la=[];
var max = 0;
var c = 0;
for(var i=0;i<line.length;i++){
	if(line[i] == '('){
		if( la[l] === undefined){
			la[l]=i;
		}
		l++;
	}else{
		l--;
		if(l>=0){
			var j = i-la[l]+1;
			if( j > max){
				max = j;
				c=1;
			}else if( j==max){
				c++;
			}
		}
	}
	if(l<0){
		l=0;
		la=[];
	}
}

if(max==0){
	c=1;
}
print(max+' '+c);

var line = readline();

var l = 0;
var a = 0;
var ret1 = 0;
var ret2 = 0;
for( var i=0; i<line.length; i++){
	if(line[i]=='('){
		l++;
	}else{
		l--;
	}

	if(l<0){
		if( a>ret1 ){
			ret1=a;
			ret2=1;
		}else if(a==ret1){
			ret2++
		}
		a = 0;
		l = 0;
	}else{
		a++;
	}
}

if(l==0){
	if( a>ret1 ){
		ret1=a;
		ret2=1;
	}else if(a==ret1){
		ret2++
	}
}else if(l>0&&ret1==0){
	ret1=0;
	ret2=1;
}

print(ret1+' '+ret2)

var line = readline();

function go(line){
	var l = 0;
	var ret1 = 0;
	var ret2 = 0;
	var ll = [];
	for( var i=0; i<line.length; i++){
		if(line[i]=='('){
			l++;
			ll.push(i);
		}else{
			//if(l>=0){
				var j = i-ll.pop()+1;
				if(j>ret1){
					ret1=j;
					ret2=1;
				}else if(j==ret1){
					ret2++;
				}
			//}
			l--;
		}

		if(l<0){
			l = 0;
			ll=[];
		}
	}
	return [ret1, ret2];
}

var ret = go(line.split(''));
if(ret[0]==0){
	ret[1]=1;
}
print(ret[0]+' '+ret[1]);

var line = readline();

function go(line){
	var l = 0;
	var ret1 = 0;
	var ret2 = 0;
	var ll = [];
	for( var i=0; i<line.length; i++){
		if(line[i]=='('){
			l++;
			ll.push(i);
		}else{
			if(l>0){
				var j = i-ll.pop()+1;
				if(j>ret1){
					ret1=j;
					ret2=1;
				}else if(j==ret1){
					ret2++;
				}
			}
			l--;
		}

		if(l<0){
			l = 0;
			ll=[];
		}
	}
	print(ll)
	return [ret1, ret2];
}

line = line.split('');
line.unshift('(');
line.push(')');
var ret = go( line );
ret[0] -= 2;
if(ret[0]==0){
	ret[1]=1;
}
print(ret[0]+' '+ret[1]);

var i, lb = [0,0], max = 0, rpt = 0, input = readline();

function closing(){
    rpt++;
    if (lb[1] > max) {
        max = lb[1];
        lb[1] = 0;
    }
}

for (i=0; i<input.length; i++){
    if (input[i] === '(') {
        lb[0]++;
    } else if (input[i] === ')') {
        if (lb[0] > 0) {
            lb[0]--;
            lb[1]+=2;
        } else {
            if (lb[1] > 0) {
                closing();
            }
        }
    }
}

if (lb[1] > 0) {
    closing();
}

if (max)
    print(max + ' ' + rpt);
else
    print('0 1');

var i, lb = [0,0], max = 0, rpt = 0, input = readline();

function closing(){
    rpt++;
    if (lb[1] > max) {
        max = lb[1];
        lb[1] = 0;
    }
}

for (i=0; i<input.length; i++){
    if (input[i] === '(') {
        lb[0]++;
        lb[1]++;
    } else if (input[i] === ')') {
        if (lb[0] > 0) {
            lb[0]--;
            lb[1]++;
        } else {
            if (lb[1] > 0) {
                closing();
            }
        }
    }
}

if (lb[1] > 0) {
    closing();
}

if (max)
    print(max + ' ' + rpt);
else
    print('0 1');


process.stdin.setEncoding('utf-8')
const readline = require('readline')

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

let count = -1
let inputArr = []

rl.on('line', data => {
    if (count === -1) {
        count = +data
    } else if (count !== 0) {
        inputArr.push(data.trim())
        count--
    }
    // max number 2^(53) - 1 ~~ 10^(15)
    if (count === 0) {
        inputArr = inputArr.map(i => i.split(' ').map(j => +j))
        main()
        process.exit(0)
    }
})

function solve([num]) {
    const res =[]
    for(let i =0;i<num;++i){
        const temp=[]
        for(let j =0;j<i+1;++j){
            temp.push('()')
        }
        temp.unshift('('.repeat(num-(i+1)))
        temp.push(')'.repeat(num-(i+1)))
        res.push(temp.join(''))
    }
    console.log(res.join('\n'))
}

function main() {
    for (let i = 0; i < inputArr.length; i++) solve(inputArr[i])
}

var limit = parseInt(readline());
for (var i = 0; i < limit; i++)
{
    var caseLength = parseInt(readline());
    for (var j = 1; j <= caseLength; j++)
    {
        var result = "";
        var remaining = caseLength-j;
        for (var k = 1; k <= j; k++)
        {
            result += "("
        }
        for (var k = 1; k <= j; k++)
        {
            result += ")"
        }
        for (var k = 1; k <= remaining; k++)
        {
            result += "("
        }
        for (var k = 1; k <= remaining; k++)
        {
            result += ")"
        }
        print(result);
    }
}

var t=Number(readline());
while(t--){
    var n=Number(readline());
    for(var i=1;i<=n;i++){
        var str="";
        var m=2*n;
        for(var j=1;j<=m;j++){
            if(j<=i)str+="(";
            else if(j>i && j<=2*i)str+=")";
            else if(j&1)str+="(";
            else str+=")";
        }
        print(str);
    }
}

  function readStringArray() {
    return readline().split(" ");
  }
  function readNumArray() {
    return readStringArray().map(Number);
  }

  function main() {
    var cache = {
      1: ['()']
    };
    function getSeq(n) {
      if (n == 1) {
        return cache[1]
      }
      if (!cache[n]) {
        var res = [];
        var prev = getSeq(n - 1);
        for (var c of prev) {
          res.push(
            '(' + c + ')',
            '()' + c
          )
          if (res.length > n) {
            res = res.slice(0, n);
          }
        }
        cache[n] = res;
      }
      return cache[n]
    }
    var testCasesNum = +readline();
    for (var i = 0; i < testCasesNum; i++) {
      var n = +readline();
      var resArr = getSeq(n);
      for (var j = 0; j < resArr.length; j++) {
        print(resArr[j]);
      }
    }
  }

  main();

function iamsogoodatgaming(n){
    var returnn = '';
    for(gamer = 0; gamer < n; gamer++){
        returnn += '(';
    }
    for(gamer2 = 0; gamer2 < n; gamer2++){
        returnn += ')';
    }
    return returnn;
}
let stop = '';
process.stdin.on('data', c => stop += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = stop.split(EOL);
	var t = lines[0];
	for(i = 1; i <= t; i++){
	   var a = lines[i];
	   for(j = 1; j <= a; j++){
	       var ans = iamsogoodatgaming(j) + iamsogoodatgaming(a - j);
	       console.log(ans);
	   }
	}
});

/* Common Template Starts */
process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on("end", (_) => {
  inputString = inputString
      .trim()
      .split("\n")
      .map((string) => {
	  return string.trim();
      });

  main();
});

function readline() {
  return inputString[currentLine++];
}
/* Common Template Ends */
function main() {
  let Q = +(readline()); // Read Input

  for (let i = 0; i < Q; i++) {
    const N = parseInt(readline());

    const results = [];
    const stringArray = [];
    go (results, stringArray, N*2, 0, 0);

    results.forEach((result) => {
      console.log(result);
    });
  }
}

const go = (results, stringArray, targetLength, currentLength, currentOpen) => {
  if (currentLength === targetLength) {
    results.push(stringArray.join(""));
    return;
  }
  if (results.length === targetLength / 2) return;

  const remain = targetLength - currentLength;
  if (currentOpen + 1 <= remain) {
    stringArray[currentLength] = '(';
    go(results, stringArray, targetLength, currentLength + 1, currentOpen + 1);
  }
  if (currentOpen > 0) {
    stringArray[currentLength] = ')';
    go(results, stringArray, targetLength, currentLength + 1, currentOpen - 1);
  }
}

https://codeforces.com/problemset/problem/1574/A

    process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main(inputString);
});

function log(message) {
    if (process.env.NODE_ENV === "debug") {
        console.log(message);
    }
}

/**
 *
 * @param bracketPairCount integer
 * @return Array<String>
 */
const generateBrackets = (bracketPairCount) => {
    //add () to the end or wrap the whole thing
    // generate a squence exaple input:3, possible sequences = AAA -> AAW -> AWA -> WAA -> AWW -> WAW ->
    // length 3 index 0: AAA, index 1: AAW, index 3
    // ADD as many wraps as there are indexes to the end and the beginning can just be adds

    let index = 0;
    const permutations = [];

    while (index < bracketPairCount) {
        let sequence = "";
        let amountOfAdds = bracketPairCount - index;
        let amountOfWraps = bracketPairCount - amountOfAdds;

        while(amountOfAdds > 0 || amountOfWraps > 0){
            if(amountOfAdds > 0){
                sequence += "()";
                amountOfAdds--;
            }else if(amountOfWraps > 0){
                sequence = "(" + sequence + ")";
                amountOfWraps--;
            }
        }

        permutations.push(sequence);
        index++;
    }

    return permutations;
}

/**
 *
 * @param bracketPairCount Array<String>
 */
const printBrackets = (listOfPossibleBracketPermutations) => {
    listOfPossibleBracketPermutations.forEach(permuatation => console.log(permuatation))
}

function main(fileContents) {//input lines as an array
    // console.log(fileContents);
    fileContents.splice(0, 1);
    fileContents
        .map(generateBrackets)
        .forEach(printBrackets)
}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else if(code == 'long'){
			ret[i] = BigInt(next());
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');} function nextLongArray(size){return nextArray(size, 'long');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);} function nextLong(){return BigInt(next());}
function getCountMap(list){
	var map = {};
	for(var i = 0; i < list.length; i++){
		if(map[list[i]] == null){
			map[list[i]] = 0;
		}
		map[list[i]]++;
	}
	return map;
}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var t = nextInt();
	while(hasNext()){
		var N = nextInt();
		var set = new Set();
		var list = [];
		for(var i = 0; i < N; i++){
			list.push("(");
			list.push(")");
		}
		set.add(myconv(list,0));
		for(var i = 1; i < 2 * N; i++){
			if(list[i] == ")" && list[i + 1] == "("){
				var tmp = list[i];
				list[i] = list[i + 1];
				list[i + 1] = tmp;
				set.add(myconv(list, 0));
				if(set.size == N){
					break;
				}
			}
		}
		set = Array.from(set);
		myout(myconv(set, 9));
	}
}

let stop = '';
process.stdin.on('data', c => stop += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = stop.split(EOL);
	var t = lines[0];
	for(i = 1; i <= t; i++){
	    var a = lines[i].split(' ').map(Number);
	    var x = a[0], y = a[1];
	    if(y % x){
	        console.log(0, 0);
	        continue;
	    }
	    y /= x;
	    console.log(1, y);
	}
});

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);
    var n = lines[0].split(' ').map(Number);
    var k = lines[1].split(' ').map(Number);
    var a = new Map();
    var length = 0;
    var flag = 0;
    for(var j = 0; j < n[0]; j++){
        if(a.has(k[j]) === false){
            a.set(k[j], j + 1);
            length++;
        }
        if(length == n[1]){
            flag = 1;
            break;
        }
    }
    if(flag === 1){
        console.log('YES');
        var answer = '';
        for(var [key, value] of a){
            answer += value + ' ';
        }
        console.log(answer);
    }else{
        console.log('NO');
    }
});