'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++];
}

var maxN = 2 * 1e5 + 10
var mod = BigInt(1e9 + 7)

// Make a Snippet for the code above this and then write your logic in main();

function main() {
  var j = 0
  var array2 = [
    3, 5, 11,
    13, 101, 103,
    1009, 1013, 10007,
    10009, 100003, 100019,
    1000003, 1000033, 10000019,
    10000079,
    179424673, 179424691
  ]

  const xx = readline();
  Array(Number(xx)).fill(1).map((t, i) => {
    // var n = parseInt(readline());
    // var [n, m] = readline().split(' ').map((x, iii) => {
    //   return parseInt(x)
    // })
    var [a, b, c] = readline().split(' ').map((x, iii) => {
      return parseInt(x)
    });
    a--
    b--
    var cc = c - 1
    if (cc === 0) {
      console.log(array2[Math.floor(a * 2)], array2[b * 2 + 1])
      return
    }
    a = a - cc
    b = b - cc
    console.log(array2[a * 2] * Math.pow(10, cc), array2[b * 2 + 1] * Math.pow(10, cc))
  })
}

var eratosthenes = function (n) {
  // Eratosthenes algorithm to find all primes under n
  var array = [], upperLimit = Math.sqrt(n), output = [];

  // Make an array from 2 to (n - 1)
  for (var i = 0; i < n; i++) {
    array.push(true);
  }

  // Remove multiples of primes starting from 2, 3, 5,...
  for (var i = 2; i <= upperLimit; i++) {
    if (array[i]) {
      for (var j = i * i; j < n; j += i) {
        array[j] = false;
      }
    }
  }

  // All array[i] set to true are primes
  for (var i = 2; i < n; i++) {
    if (array[i]) {
      output.push(i);
    }
  }

  return output;
};

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function solve(a, b, c) {
  function getPrime(n) {
    next: while (n++) {
      for (let i = 2; i <= n / i; i++) {
        if (n % i === 0) continue next;
      }
      return n;
    }
    return 1;
  }
  let z = getPrime(10 ** (c - 1));
  let x = 1;
  let y = 1;
  if (a === b) {
    x = getPrime(Math.floor(10 ** (a - 1) / z) + 1);
    y = getPrime(x);
  } else {
    x = getPrime(Math.floor(10 ** (a - 1) / z) + 1);
    y = getPrime(Math.floor(10 ** (b - 1) / z) + 1);
  }
  x = BigInt(x) * BigInt(z);
  y = BigInt(y) * BigInt(z);
  return `${x.toString()} ${y.toString()}`;
}

async function main(read) {
  let res = [];
  let t = Number(await read());
  while (t--) {
    const [a, b, c] = (await read()).split(' ').map(Number);
    res.push(solve(a, b, c));
  }
  console.log(res.join('\n'));
}

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
void async function () {
  const inputs = [];
  let i = 0;
  for await (const line of rl) {
    inputs.push(line.trim());
  }
  function read() {
    return inputs[i++];
  }
  await main(read);
}();

const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
let input = [];
rl.on('line', line => {
    input.push(line);
})
rl.on('close', line => {
    var t = Number(input[0]);
    for (var i = 1; i < input.length; i++) {
        var [a, b, c] = input[i].split(" ").map((i) => {
            return Number(i);
        });
        var num1 = 10 ** (a - 1);
        var num2 = 10 ** (b - 1) + 10 ** (c - 1);
        console.log(num1 + " " + num2);
    }
})

/*
| In English По-русски
lukas_rimkus | Logout

HOME
TOP
CONTESTS
GYM
PROBLEMSET
GROUPS
RATING
EDU
API
CALENDAR
HELP

PROBLEMSSUBMIT CODEMY SUBMISSIONSSTATUSHACKSSTANDINGSCUSTOM INVOCATION

My contest submissions

#	When	Who	Problem	Lang	Verdict	Time	Memory
112854886	Apr/12/2021 18:31UTC+2	lukas_rimkus	B - GCD Length	Node.js	Time limit exceeded on test 2	2000 ms	12000 KB
112853780	Apr/12/2021 18:29UTC+2	lukas_rimkus	B - GCD Length	Node.js	Wrong answer on test 1	31 ms	0 KB
112852890	Apr/12/2021 18:27UTC+2	lukas_rimkus	B - GCD Length	Node.js	Wrong answer on test 1	31 ms	0 KB
112851646	Apr/12/2021 18:24UTC+2	lukas_rimkus	B - GCD Length	Node.js	Time limit exceeded on test 1	2000 ms	11800 KB
112851156	Apr/12/2021 18:23UTC+2	lukas_rimkus	B - GCD Length	Node.js	Wrong answer on test 1	46 ms	0 KB
112849514	Apr/12/2021 18:19UTC+2	lukas_rimkus	B - GCD Length	Node.js	Time limit exceeded on test 2	2000 ms	11800 KB
112845911	Apr/12/2021 18:11UTC+2	lukas_rimkus	B - GCD Length	Node.js	Wrong answer on test 1	373 ms	11300 KB
112834898	Apr/12/2021 17:47UTC+2	lukas_rimkus	A - Review Site	Node.js	Accepted	218 ms	6100 KB

Educational Codeforces Round 107 (Rated for Div. 2)
Finished
Practice
Add to favourites

→ Virtual participation
Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - solve these problems in the archive. If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive. Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

→ Practice
You are registered for practice. You can solve problems unofficially. Results can be found in the contest status and in the bottom of standings.

→ Clone Contest to Mashup
You can clone this contest to a mashup.

→ Contest materials
Announcement

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov
The only programming contests Web 2.0 platform
Server time: Apr/12/2021 23:55:11UTC+2 (h2).
Mobile version, switch to desktop version.
Privacy Policy
Supported by
Telegram ИТМО
By lukas_rimkus, contest: Educational Codeforces Round 107 (Rated for Div. 2), problem: (B) GCD Length, Time limit exceeded on test 2, #, Copy
*/
'use-strict'

process.stdin.resume();
process.stdin.setEncoding('utf8');

let data = '';
let currentLine = 0;

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

process.stdin.on('end', () =>{
    data = data.replace(/\s*$/, '')
    .split('\n')
    .map(str => str.replace(/\s*$/, ''));

    let testCases = parseInt(readLine());

    while(testCases--) {
        const [a,b,c] = readLine().split(' ').map(Number );
        const x = Math.pow(10,a-1) + Math.pow(10,c-1);
        const y = Math.pow(10,b-1);
        console.log(x,y)

    }
})

function readLine(){
    return data[currentLine++]
}

//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{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);}
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();
	for(var i = 0; i < t; i++){
		var a = nextInt();
		var b = nextInt();
		var c = nextInt();
		var g = Math.pow(10, c - 1);
		var x = g;
		var y = g;
		while(x < Math.pow(10, a - 1)){
			x *= 3;
		}
		while(y < Math.pow(10, b - 1)){
			y *= 7;
		}
		myout(x + " " + y);
	}
}

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  const gcd = (a, b) => (a % b === 0 ? b : gcd(b, a % b));
  while (t--) {
    let [a, b, c] = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let g = 1,
      f = 1,
      s = 1;
    for (let i = 2; i <= c; i++) g *= 10;
    for (let i = 2; i <= a; i++) f *= 10;
    for (let i = 2; i <= b; i++) s *= 10;
    if (f >= s) s += g;
    else f += g;
    console.log(f + " " + s);
  }
};
solve();

'use-strict'

process.stdin.resume();
process.stdin.setEncoding('utf8');

let data = '';
let currentLine = 0;

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

process.stdin.on('end', () =>{
    data = data.replace(/\s*$/, '')
    .split('\n')
    .map(str => str.replace(/\s*$/, ''));

    let testCases = parseInt(readLine());

    while(testCases--) {

        const [a,b,c] = readLine().split(' ').map(Number);

        let xstart = '1';

        for(let i = 1 ; i < a; i++){
            xstart+= '0';
        }
        xstart = parseInt(xstart);
        let xend = '';
        for(let i = 0; i < a; i++){
            xend+= '9';
        }
        xend = parseInt(xend);

        let ystart = '1';
        for(let i = 1; i < b; i++){
            ystart += '0';
        }
        ystart = parseInt(ystart);

        let yend = '';
        for(let i = 0; i < b; i++){
            yend += '9';
        }
        yend = parseInt(yend);

        let cstart = '1';
        for(let i = 1; i < c; i++){
            cstart += '0';
        }
        cstart = parseInt(cstart);

        let cend = '';
        for(let i = 0; i < c; i++){
            cend += '9';
        }
        cend = parseInt(cend);

        let stop = false;
        for(let i = xstart; i <= xend; i++){
            if(Number(i.toString().split('').pop()) === 0) continue;
            for(let j = ystart; j <= yend; j++){
                if(Number(j.toString().split('').pop()) === 0) continue;
                    var ans = gcd(i,j);
                    if(ans.toString().length === c.toString().length && Number(ans.toString().split('').pop() !== 0)){
                        console.log(i,j);
                        stop = true;
                        break;
                    }
            }
            if(stop) break;
        }
    }
});

function get_ints() {
    return data.shift().split(' ').map(Number);
}

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

function gcd(x, y) {
    if ((typeof x !== 'number') || (typeof y !== 'number'))
      return false;
    x = Math.abs(x);
    y = Math.abs(y);
    while(y) {
      var t = y;
      y = x % y;
      x = t;
    }
    return x;
  }

'use-strict'

process.stdin.resume();
process.stdin.setEncoding('utf8');

let data = '';
let currentLine = 0;

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

process.stdin.on('end', () =>{
    data = data.replace(/\s*$/, '')
    .split('\n')
    .map(str => str.replace(/\s*$/, ''));

    let testCases = parseInt(readLine());

    while(testCases--) {

        const [a,b,c] = readLine().split(' ').map(Number);

        let xstart = '1';

        for(let i = 1 ; i < a; i++){
            xstart+= '0';
        }
        xstart = parseInt(xstart);
        let xend = '';
        for(let i = 0; i < a; i++){
            xend+= '9';
        }
        xend = parseInt(xend);

        let ystart = '1';
        for(let i = 1; i < b; i++){
            ystart += '0';
        }
        ystart = parseInt(ystart);

        let yend = '';
        for(let i = 0; i < b; i++){
            yend += '9';
        }
        yend = parseInt(yend);

        let cstart = '1';
        for(let i = 1; i < c; i++){
            cstart += '0';
        }
        cstart = parseInt(cstart);

        let cend = '';
        for(let i = 0; i < c; i++){
            cend += '9';
        }
        cend = parseInt(cend);

        let stop = false;
        for(let i = xstart; i <= xend; i++){
            if(Number(i.toString().split('').pop()) === 0) continue;
            for(let j = ystart; j <= yend; j++){
                if(Number(j.toString().split('').pop()) === 0) continue;
                    if(gcd(i,j).toString().length === c.toString().length){
                        console.log(i,j);
                        stop = true;
                        break;
                    }
            }
            if(stop) break;
        }
    }
});

function get_ints() {
    return data.shift().split(' ').map(Number);
}

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

function gcd(x, y) {
    if ((typeof x !== 'number') || (typeof y !== 'number'))
      return false;
    x = Math.abs(x);
    y = Math.abs(y);
    while(y) {
      var t = y;
      y = x % y;
      x = t;
    }
    return x;
  }

'use-strict'

process.stdin.resume();
process.stdin.setEncoding('utf8');

let data = '';
let currentLine = 0;

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

process.stdin.on('end', () =>{
    data = data.replace(/\s*$/, '')
    .split('\n')
    .map(str => str.replace(/\s*$/, ''));

    let testCases = parseInt(readLine());

    while(testCases--) {

        const [a,b,c] = readLine().split(' ').map(Number);

        let xstart = '1';

        for(let i = 1 ; i < a; i++){
            xstart+= '0';
        }
        xstart = parseInt(xstart);
        let xend = '';
        for(let i = 0; i < a; i++){
            xend+= '9';
        }
        xend = parseInt(xend);

        let ystart = '1';
        for(let i = 1; i < b; i++){
            ystart += '0';
        }
        ystart = parseInt(ystart);

        let yend = '';
        for(let i = 0; i < b; i++){
            yend += '9';
        }
        yend = parseInt(yend);

        let cstart = '1';
        for(let i = 1; i < c; i++){
            cstart += '0';
        }
        cstart = parseInt(cstart);

        let cend = '';
        for(let i = 0; i < c; i++){
            cend += '9';
        }
        cend = parseInt(cend);

        let stop = false;
        for(let i = xstart; i <= xend; i++){
            if(Number(i.toString().split('').pop()) === 0) continue;
            for(let j = ystart; j <= yend; j++){
                if(Number(j.toString().split('').pop()) === 0) continue;
                    if(gcd(i,j) === c.toString().length){
                        console.log(i,j);
                        stop = true;
                        break;
                    }

            }
            if(stop) break;
        }
    }
});

function get_ints() {
    return data.shift().split(' ').map(Number);
}

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

function gcd(x, y) {
    if ((typeof x !== 'number') || (typeof y !== 'number'))
      return false;
    x = Math.abs(x);
    y = Math.abs(y);
    while(y) {
      var t = y;
      y = x % y;
      x = t;
    }
    return x;
  }

'use-strict'

process.stdin.resume();
process.stdin.setEncoding('utf8');

let data = '';
let currentLine = 0;

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

process.stdin.on('end', () =>{
    data = data.replace(/\s*$/, '')
    .split('\n')
    .map(str => str.replace(/\s*$/, ''));

    let testCases = parseInt(readLine());

    while(testCases--) {

        const [a,b,c] = readLine().split(' ').map(Number);

        let xstart = '1';

        for(let i = 1 ; i < a; i++){
            xstart+= '0';
        }
        xstart = parseInt(xstart);
        let xend = '';
        for(let i = 0; i < a; i++){
            xend+= '9';
        }
        xend = parseInt(xend);

        let ystart = '1';
        for(let i = 1; i < b; i++){
            ystart += '0';
        }
        ystart = parseInt(ystart);

        let yend = '';
        for(let i = 0; i < b; i++){
            yend += '9';
        }
        yend = parseInt(yend);
        let stop = false;
        for(let i = xstart; i <= xend; i++){
            if(Number(i.toString().split('').pop()) === 0) continue;
            for(let j = ystart; j <= yend; j++){
                if(Number(j.toString().split('').pop()) === 0) continue;
                if(gcd(i,j) === c){
                    console.log(i,j);
                    stop = true;
                    break;
                }
            }
            if(stop) break;
        }
    }
});

function get_ints() {
    return data.shift().split(' ').map(Number);
}

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

function gcd(x, y) {
    if ((typeof x !== 'number') || (typeof y !== 'number'))
      return false;
    x = Math.abs(x);
    y = Math.abs(y);
    while(y) {
      var t = y;
      y = x % y;
      x = t;
    }
    return x;
  }

//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{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);}
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();
	for(var i = 0; i < t; i++){
		var a = nextInt();
		var b = nextInt();
		var c = nextInt();
		var g = Math.pow(10, c - 1);
		var x = g;
		var y = g;
		while(x < Math.pow(10, a - 1)){
			x *= 2;
		}
		while(y < Math.pow(10, b - 1)){
			y *= 2;
		}
		myout(x + " " + y);
	}
}

//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{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);}
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();
	for(var i = 0; i < t; i++){
		var a = nextInt();
		var b = nextInt();
		var c = nextInt();
		var g = Math.pow(10, c - 1);
		var x = 1;
		var y = 1;
		while(x < Math.pow(10, a - 1)){
			x *= 2;
		}
		while(y < Math.pow(10, b - 1)){
			y *= 2;
		}
		myout(x + " " + y);
	}
}


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

rl.on('line', (d) => {
  if (c === 0) {
    c++;
    [b, k] = d.split(' ').map(Number);
    return;
  }

  const arr = d.split(' ').map(Number);
  let odd = arr[arr.length - 1] % 2;

  for (let i = 0; i < arr.length - 1; i++) {
    if ((arr[i] * b) % 2) {
      odd++;
    }
  }

  if (odd % 2) {
    console.log('odd');
  }
  else {
    console.log('even');
  }

  c++;
});

(function() {
    var read = {
        number: function() {
            return +readline();
        },
        arr: function(divider) {
            return readline().split(divider ? divider : '');
        },
        arrNumber: function(divider) {
            return readline()
                .split(divider ? divider : '')
                .map(item => +item);
        }
    }

    var n = read.arrNumber(' ');
    var b = n[0];
    var k = n[1];

    var a = read.arrNumber(' ');

    var res = a[k - 1];
    var last = b;

    for(var i = k - 2; i >= 0; i--) {
        var number = a[i] * last;
        var str = number.toString();
        var y = +(str[str.length - 1]);
        var lastString = (last * b).toString();
        last = +lastString[lastString.length - 1];
        res += number;
    }
    print(res % 2 ? 'odd' : 'even');
}());

(function() {
    var read = {
        number: function() {
            return +readline();
        },
        arr: function(divider) {
            return readline().split(divider ? divider : '');
        },
        arrNumber: function(divider) {
            return readline()
                .split(divider ? divider : '')
                .map(item => +item);
        }
    }

    var n = read.arrNumber(' ');
    var b = n[0];
    var k = n[1];

    var a = read.arrNumber(' ');

    var res = 0;

    var hh = 0;
    var last = b;
    a.forEach(function(i){
        var str = (i * b).toString();
        var y  = +(str[str.length - 1])
        res += y;
        last = y;
        hh++;
    });

    print(res % 2 ? 'odd' : 'even');
}());


"use strict";

//                                  import for reading input                                  //
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.split("\n");
  main();
});
function readline() {
  return inputString[currentLine++];
}
//                                                                                //
function main() {
  var t = +(readline());
  while (t--) {
    solution();
  }
}

function solution() {
  const n = +(readline());
  const arr = readline().split(' ').map((item) => +item);

  let counter = 0;
  for (let i = 0; i < n-1; i++) {
    let r = (i+1)%arr[i];
    let firstJ = (arr[i] - r > r) ? (i+1-2*r+arr[i]) : (i+1+2*(arr[i]-r));
    for (let j = firstJ-1; j < n; j += arr[i]) {
      if (arr[i]*arr[j] === i+j+2) counter++;
    }
  }
  console.log(counter);
}

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let bool = [];
    let k = Math.ceil(Math.sqrt(n + n - 1));
    for (let i = 0; i < n; i++) {
      if (arr[i] <= k) bool[i] = true;
      else bool[i] = false;
    }
    let cnt = 0,
      obj = {};
    for (let i = 0; i < n; i++) {
      if (bool[i]) {
        for (let j = 0; j < n; j++) {
          if (i === j) continue;
          let k = i + 1 + (j + 1);
          if (k === arr[i] * arr[j]) {
            let s1 = `${i + 1} ${j + 1}`;
            let s2 = `${j + 1} ${i + 1}`;
            if (!obj[s1] && !obj[s2]) cnt++;
            obj[s1] = 1;
            obj[s2] = 1;
          }
        }
      }
    }
    console.log(cnt);
  }
};
solve();

const stdin = process.openStdin();
let content = '';

stdin.addListener('data', (data) => {
          content += data;
})

stdin.addListener('end', () => {
          content = content.split('\n');
          content.shift();
          content = content.map((string) => string.substring(0, string.length - 1));
          content.pop();
          content.forEach((str, i) => {
                    if (i % 2 === 1) {
                              str = str.split(' ').map(str => parseInt(str));
                              console.log(pleasantPairs(str));
                    }
          });
})

const pleasantPairs = (arr) => {
          let pairCount = 0;
          for (let i = 0; i < arr.length - 1; i++) {
                    let multiple = 1;
                    let j = (arr[i] * multiple) - (i + 1) - 1;
                    while (j < arr.length) {
                              if ((arr[j] * arr[i]) === (i + j + 2) && i < j) {
                                        pairCount++;
                              }
                              multiple++;
                              j = (arr[i] * multiple) - (i + 1) - 1;
                    }
          }
          return pairCount;
}

var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
var lines = [];
rl.on('line', function(input) {
    lines.push(input);
});
rl.on('close', function() {
    var t = +lines[0]
    var l = 1;
    for (var i = 0; i < t; i++) {
        var n = +lines[l++]
        var arr = lines[l++].split(' ').map(Number)
        console.log(solve(n, arr));
    }
});

function solve(n, arr) {
    let count = 0
    arr.forEach((a, i) => {
        i++
        const limit = Math.floor(2 * n / a)
        for (let j = 1; j <= limit; j++) {
            const p = a * j - i - 1
            if (p > i - 1 && arr[p] === j) count++
        }
    })
    return count
}

var dataitr;
var stdin_input = "";
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on("data", function (input) { stdin_input += input; });
process.stdin.on("end", function () { dataitr = stdin_input.split('\n').values(); main(); });

const rl = () => dataitr.next().value.trim();
const rn = () => Number(rl());
const ra = () => rl().split(' ');
const rna = () => ra().map(x => Number(x));

function main () {
	let T = rn();
	while (T--) {
		const n = rn();
		const a = rna();
		a.unshift(0);

		let ans = 0;
		for (let i = 1; i <= n; i++) {
			const start = Math.ceil((2*i+1)/a[i])*a[i] - i;
			for(j = start; j <= n; j += a[i]) {
				ans += a[i] * a[j] == i + j;
			}
		}

		console.log(ans);
	}
}

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

const getLine = (function () {
    const getLineGen = (async function* () {
        for await (const line of rl) {
            yield line;
        }
    })();
    return async () => {
        let next;
        do {
            next = (await getLineGen.next());
        } while (!next.done && next.value === '');
        return next.value;
    };
})();

let solve = async () => {
    let nsc = parseInt(await getLine());
    for(let sc = 0; sc < nsc; sc++) {
        const n = parseInt(await getLine());
        const a = (await getLine()).split(' ').map(num => parseInt(num));
        let count = 0;
        for(let i = 0; i < n; i++) {
            let rem = (i + 1) % a[i];
            let need = (a[i] - rem) % a[i];
            let delta = (a[i] + need - rem) % a[i];
            for(let j = 0; i + 1 + delta + a[i] * j <= n; j++) {
                let ind2 = i + 1 + delta + a[i] * j;
                if (ind2 == i + 1)
                    continue;
                if (a[i] * a[ind2-1] === i + 1 + ind2)
                    count++;
            }
        }
        console.log(count);
    }
}

solve();

var t = +readline();
for (var tt = 0; tt < t; tt += 1) {
  var n = +readline();
  var arr = readline()
    .split(" ")
    .map((num) => {
      return +num;
    });
  arr.unshift(0);
  var find = [];
  for (var k = 1; k <= n; k += 1) {
    var numToFind = 1;
    while (true) {
      var indexToFind = Math.abs(arr[k] * numToFind - k);
      if (indexToFind <= n) {
        if (indexToFind > k) find.push([numToFind, indexToFind]);
      } else {
        break;
      }
      numToFind += 1;
    }
  }
  var ans = 0;
  find.forEach((value) => {
    if (arr[value[1]] === value[0]) ans += 1;
  });
  print(ans);
}

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let bool = [];
    let k = Math.ceil(Math.sqrt(n + n - 1));
    for (let i = 0; i < n; i++) {
      if (arr[i] <= k) bool[i] = true;
      else bool[i] = false;
    }
    let cnt = 0,
      obj = {};
    for (let i = 0; i < n; i++) {
      if (bool[i]) {
        for (let j = 0; j < n; j++) {
          let k = i + 1 + (j + 1);
          if (k === arr[i] * arr[j]) {
            let s1 = `${i + 1} ${j + 1}`;
            let s2 = `${j + 1} ${i + 1}`;
            if (!obj[s1] && !obj[s2]) cnt++;
            obj[s1] = 1;
            obj[s2] = 1;
          }
        }
      }
    }
    console.log(cnt);
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let bool = [];
    let k = Math.ceil(Math.sqrt(n));
    for (let i = 0; i < n; i++) {
      if (arr[i] <= k) bool[i] = true;
      else bool[i] = false;
    }
    let cnt = 0,
      obj = {};
    for (let i = 0; i < n; i++) {
      if (bool[i]) {
        for (let j = 0; j < n; j++) {
          let k = i + 1 + (j + 1);
          if (k === arr[i] * arr[j]) {
            let s1 = `${i + 1} ${j + 1}`;
            let s2 = `${j + 1} ${i + 1}`;
            if (!obj[s1] && !obj[s2]) cnt++;
            obj[s1] = 1;
            obj[s2] = 1;
          }
        }
      }
    }
    console.log(cnt);
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let bool = [];
    let k = Math.ceil(Math.sqrt(n));
    for (let i = 0; i < n; i++) {
      if (arr[i] <= k) bool[i] = true;
      else bool[i] = false;
    }
    let cnt = 0,
      obj = {};
    for (let i = 0; i < n; i++) {
      if (bool[i]) {
        for (let j = 0; j < n; j++) {
          let k = i + 1 + (j + 1);
          if (k === arr[i] * arr[j]) {
            if (!obj[i + j + 2]) cnt++;
            obj[i + j + 2] = 1;
          }
        }
      }
    }
    console.log(cnt);
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let bool = [];
    let k = Math.floor(Math.sqrt(n));
    for (let i = 0; i < n; i++) {
      if (arr[i] <= k) bool[i] = true;
      else bool[i] = false;
    }
    let cnt = 0;
    for (let i = 0; i < n; i++) {
      if (bool[i]) {
        for (let j = 0; j < n; j++) {
          let k = i + 1 + (j + 1);
          if (k === arr[i] * arr[j]) cnt++;
        }
      }
    }
    console.log(cnt);
  }
};
solve();

var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
var lines = [];
rl.on('line', function(input) {
    lines.push(input);
});
rl.on('close', function() {
    var t = +lines[0]
    var l = 1;
    for (var i = 0; i < t; i++) {
        var n = +lines[l++]
        var arr = lines[l++].split(' ').map(Number)
        console.log(solve(n, arr));
    }
});

function solve(n, arr) {
    let count = 0
    arr.forEach((a, i) => {
        i++
        const limit = Math.floor(2 * n / a)
        for (let j = 1; j <= limit; j++) {
            if (arr[a * j - i - 1] === j) count++
        }
    })
    return count / 2
}


var n = readline();
var b=n;
var res = [];
while (n--){
    res.push(Array(parseInt(readline())).fill(1))
}
for(var i =0;i<b;i++){
    write(res[i].join(" ") + "\n")
}

function solve() {
   var n = Number(read());
   var ans = '';
   for (var  i = 0; i < n; i++) {
      ans += '1 ';
   }
   write(ans);
}

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();
}

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++];
}
function main() {
  let t = +readLine();
  while (t--) {
    const len = +readLine();
    const result = Array(len).fill(1).join(" ");
    console.log(result);
  }
}

//Don't have to see. start------------------------------------------
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 = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
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){
  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";}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//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();
  var output = new Array(t);
  for(var i = 0; i < t; i++){
    var N = nextInt();
    var list = new Array(N).fill(1);
    output[i] = myconv(list, 8);
  }
  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 n = data[i] * 1;
	  let arr = Array(n).fill(1);
	  arr = arr.join(' ');
	  console.log(arr);
	  i += 1;
	}
}

'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 readint() {
    let line = readline().split(' ').map(function(num) {
        return parseInt(num);
    });
    return line;
}

function readfloat() {
    let line = readline().split(' ').map(function(num) {
        return parseFloat(num);
    });
    return line;
}

function print(x) {
    console.log(x);
}

function write(x) {
    process.stdout.write(x);
}
function main() {
    let t = parseInt(readline());
    //go go bro!!!
    while(t--) {
        let n = readint();
        while(n--) {
            write(1 + " ");
        }
        write("\n");
    }

}

// node template.js < A-small.in > A-small.out

function main() {
    var tests = 1;
    tests = nextInt();

    for (let t = 1; t <= tests; t++) {
        let N = nextInt();

        for(let i = 0; i < N; i++) {
            process.stdout.write(N + " ");
        }
        print("");
    }
}

// ------- Template ------------------
function newTensor(dimensions, value) {
    let res = [];
    let dim = dimensions[0], subdim = dimensions.slice(1);
    if (subdim.length == 0) {
        for(let i = 0; i < dim; i++) {
            res.push(value);
        }
    } else {
        for(let i = 0; i < dim; i++) {
            res.push(newTensor(subdim, value));
        }
    }
    return res;
}

if (!String.prototype.startsWith) {
    Object.defineProperty(String.prototype, 'startsWith', {
        value: function(search, rawPos) {
            var pos = rawPos > 0 ? rawPos|0 : 0;
            return this.substring(pos, pos + search.length) === search;
        }
    });
}
if (!String.prototype.endsWith) {
    String.prototype.endsWith = function(search, this_len) {
        if (this_len === undefined || this_len > this.length) {
            this_len = this.length;
        }
        return this.substring(this_len - search.length, this_len) === search;
    };
}

var curTokens = [], curToken = 0;

function next() {
    while (curToken >= curTokens.length) {
        curTokens = readline().split(/[\s]+/);
        curToken = 0;
    }
    return curTokens[curToken++];
}

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

// code for nodejs
var inputBuffer = '', curLine = 0;

function readline() {
    return inputBuffer[curLine++];
}

function print(data) {
    process.stdout.write(data + '\n');
}

process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
    inputBuffer += chunk;
});

process.stdin.on('end', function () {
    inputBuffer = inputBuffer.split(/[\s]+/);
    main();
});

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();
    });

    A();
});

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

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function A(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let n = pi(readline());
        let ans = '';
        for(let i = 0; i < n; i++){
            ans += '1 ';
        }
        console.log(ans);
    }
}

'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++];
}
/**
4
3
1 2 3
4
3 1 2 4
3
2 3 1
6
2 4 6 1 3 5

**/

function gcd(a, b) {
    if (!b) {
        return a;
    }

    return gcd(b, a % b);
};

function main() {
    let n = Number(readline());

    for(let r=0;r<n;r++) {
        solve();
    }

}

function solve() {
    let n = Number(readline())

    let min = 1;
    let max = 1000;

    let a = [];

        while(a.length < n / 2) {
            a.push(384);
        }

        while(a.length >= n / 2 && a.length < n) {
            a.push(44);
        }

    console.log(a.join(" "));
}

var n = readline();
var b=n;
var res = [];
while (n--){
    res.push(Array(parseInt(readline())).fill(1))
}
for(var i =0;i<b;i++){
    write(res[i].join(" "))
}

//Don't have to see. start------------------------------------------
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 = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
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){
  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";}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//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();
  var output = new Array(t);
  for(var i = 0; i < t; i++){
    var N = nextInt();
    var list = [];
    for(var j = 0; j < N; j++){
      list.push(j * 2 + 1);
    }
    output[i] = myconv(list, 8);
  }
  myout(myconv(output, 9));
}

'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 readint() {
    let line = readline().split(' ').map(function(num) {
        return parseInt(num);
    });
    return line;
}

function readfloat() {
    let line = readline().split(' ').map(function(num) {
        return parseFloat(num);
    });
    return line;
}

function print(x) {
    console.log(x);
}

function write(x) {
    process.stdout.write(x);
}
function main() {
    let t = parseInt(readline());
    //go go bro!!!
    while(t--) {
        let n = readint();
        while(n--) {
            write(1 + " ");
        }
        print('\n');
    }

}

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();
    });

    A();
});

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

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function A(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let n = pi(readline());
        let res = [];
        res.push(1);
        res.push(3);
        let last = 1+2;
        for(let i = 2; i < n; i++){
            res.push(res[res.length-1]+res[res.length-2]+1);
        }

        let ans = '';
        for(let i of res)
            ans += `${i} `;
        console.log(ans);
    }
}

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();
    });

    A();
});

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

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function A(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let n = pi(readline());
        let res = [];
        res.push(1);
        res.push(2);
        let last = 1+2;
        for(let i = 2; i < n; i++){
            res.push(res[res.length-1]+res[res.length-2]+1);
        }

        for(let i of res)
            console.log(i);
    }
}

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();
    });

    A();
});

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

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function A(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let n = pi(readline());
        let res = [];
        res.push(1);
        res.push(2);
        let last = 1+2;
        for(let i = 2; i < n; i++){
            res.push(res[res.length-1]+res[res.length-2]+1);
        }

        let ans = '';
        for(let i of res)
            ans += `${i} `;
        console.log(ans);
    }
}

'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++];
}
/**
4
3
1 2 3
4
3 1 2 4
3
2 3 1
6
2 4 6 1 3 5

**/

function gcd(a, b) {
    if (!b) {
        return a;
    }

    return gcd(b, a % b);
};

function main() {
    let n = Number(readline());

    for(let r=0;r<n;r++) {
        solve();
    }

}

function solve() {
    let n = Number(readline())

    let min = 1;
    let max = 1000;

    let a = [];
    while(a.length < n) {
        if(min !== max) {
            a.push(min);
            if(a.length !== n) {
                a.push(max);
            }

            min++;
            max--;
        }

    }

    console.log(a.join(" "));
}

'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++];
}
/**
4
3
1 2 3
4
3 1 2 4
3
2 3 1
6
2 4 6 1 3 5

**/

function gcd(a, b) {
    if (!b) {
        return a;
    }

    return gcd(b, a % b);
};

function main() {
    let n = Number(readline());

    for(let r=0;r<n;r++) {
        solve();
    }

}

function solve() {
    let n = Number(readline())

    let min = 1;
    let max = 1000;

    let a = [];
    while(a.length < n) {
        if(min !== max) {
            a.push(min);
            a.push(max);

            min++;
            max--;
        }

    }

    console.log(a.join(" "));
}


var arr = readline().split(' ').map(Number);
var n = arr[0];
var m = arr[1];
arr = [];
var cursor = 0;
for (var i = 0; i < n; i++) {
	var temp = readline().split(' ').map(Number);
	var left = temp[0];
	var right = temp[1];

	if (left > cursor) {
		break;
	}
	if (right > cursor) {
		cursor = right;
	}
}

if (cursor >= m) {
	print('YES');
} else {
	print('NO');
}

var line = readline().split(' ');
var N = parseInt(line[0]);
var M = parseInt(line[1]);
var a = [], b=[];

for(var i = 0; i < N; i++) {
	var line = readline().split(' ');
	a[i] = parseInt(line[0]);
	b[i] = parseInt(line[1]);
}

var left = 0;

for(var i=0;i<N;i++){
	if(a[i]<=left && b[i] >left ){
		left = b[i];
	}
}

if(M <= left){
	print("YES");
}else{
	print("NO");
}

// write by lpy in 2017/12/21
//title is Visting a Friend
/*
	the input of this argument
*/
var arr = readline().split(" ");
var n = Number(arr[0]);
var m = Number(arr[1]);

function input_str(n){
	// var array = [[0,2],[2,4],[3,5]];
	var array = new Array();
	for(var i = 0; i < n;i++){
		array[i] = new Array();
		var str = readline().split(" ");
		array[i][0] = Number(str[0]);
		array[i][1] = Number(str[1]);
	}
	return array;
}

function f(n,m){// n is the number of input, m is the friend's house
	var array = input_str(n);
	var left = array[0][0],right = array[0][1];
	// console.log(left, right);
	var result = true;
	for(var i = 1; i < n; i++){
		var a1 = left, b1 = right;
		// console.log(a1, b1);
		var a2 = array[i][0], b2 = array[i][1];
		if(a1 <= a2){
			left = a1;
			if(a2 <= b1){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else{
				result = false;
			}
		}
		else {
			left = a2;
			if(a1 <= b2){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else result = false;
		}
	}
	var ans;
	if(result===true){
		if(left === 0 && right === m)
			ans = 'YES';
		else ans = 'NO';
	}
	else ans = 'NO';
	return ans;
}
print(f(n, m));
// console.log(f(2,1));

one=readline();
n=parseInt(one.split(' ')[0]);
m=parseInt(one.split(' ')[1]);
mas=[];
function compareNumeric(x, y) {
  if (x.a > y.a) return 1;
  if (x.a < y.a) return -1;
  if (x.a === y.a) {
    if (x.b > y.b) return 1;
    if (x.b < y.b) return -1;
  }
}
for(i=0;i<n;i++) {
    one=readline();
    mas[i]={};
    mas[i].a = parseInt(one.split(' ')[0]);
    mas[i].b = parseInt(one.split(' ')[1]);
}
mas.sort(compareNumeric);
max=0;
f=false;
for(i=0;i<n;i++) {
    if(mas[i].a <= max) {
       if(mas[i].b > max) {
           max = mas[i].b;
           if (max >= m) {
               f = true;
               break;
           }
       }
    } else {
       break;
    }
}
if (f) {print('YES');} else {print('NO');}

var read = readline().split(" ").map(Number);
var loop = read[0];
var limit = read[1];
var reject = false;
var found = false;
var lst = 0;
function getPt( loop, limit ){
		 while( loop ){
			    loop--;
				var arr = readline().split(" ").map(Number);
				var x = arr[0];var y = arr[1];
				if ( x > lst ){
					   reject = true;
					   break;
				}
				if ( y > lst ){
					   lst = y;
					   if( lst == limit ){
							   found = true;
							   break;
						}
			    }

		 }

		 if(reject)
				write("NO\n");
		 if(found)
				write("YES\n");
		 if(!reject && !found)
				write( lst == limit ? "YES" : "NO");
}

getPt( loop, limit);

// FUCK IT I FORGOT, VALUES IN ARRAY SHOULD
// BE PARSEINT SO THAT I USED .map(Number);
var read = readline().split(" ").map(Number);
var loop = read[0];
var limit = read[1];
var reject = false;
var found = false;
var lst = 0;
getPt( loop, limit);
function getPt( loop, limit ){
				 while( loop ){
					 			loop--;
								var arr = readline().split(" ").map(Number);
								var x = arr[0];var y = arr[1];
								if ( x > lst ){
											 reject = true;
											 break;
								}
								if ( y > lst ){
											 lst = y;
											 if( lst == limit ){
												 			 found = true;
															 break;
											 }
								}

				 }
				 if(reject)
				 			 write("NO\n");
				 if(found)
				 			 write("YES\n");
				 if(!reject && !found){
					 		 write( lst == limit ? "YES" : "NO");
				 }
}

var x=readline().split(' ')
n=Number(x[0])
m=Number(x[1])
A=[]
B=[]
for (var i=0;i<n; ++i) {
	x=readline().split(' ')
	A.push(Number(x[0]))
	B.push(Number(x[1]))
}

T=[]
for (var i=0; i<n; ++i) {
	for (var j=A[i]; j<B[i]; ++j) {
		T[j] = true;
	}
}

R=true
for (var i=0;i<m;++i) R = R && T[i]
print(R?'YES':'NO')

// write by lpy in 2017/12/21
//title is Visting a Friend
/*
	the input of this argument
*/
var arr = readline().split(" ");
var n = arr[0];
var m = arr[1];

//var array = [[0,4],[2,6],[6,7]];

function f(n,m){// n is the number of input, m is the friend's house

	//the [left,right]is existing range
	var str = readline().split(" ");
	var left = str[0], right = str[1];
	var result = 'YES';
	for(var i = 1; i < n; i++){
		var array = readline().split(" ");
		var a1 = left, b1 = right;
		// var a2 = array[i][0], b2 = array[i][1];
		var a2 = array[0],b2 = array[1];
		if(a1 <= a2){
			left = a1;
			if(a2 <= b1){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else{
				result = 'NO';
			}
		}
		else {
			left = a2;
			if(a1 <= b2){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else result = 'NO';
		}
	}
	return result;
}
print(f(n, m));
// console.log(f(3,5));

// write by lpy in 2017/12/21
//title is Visting a Friend
/*
	the input of this argument
*/
var arr = readline().split(" ");
var n = arr[0];
var m = arr[1];

// var array = [[1,1],[0,0]];

function f(n,m){// n is the number of input, m is the friend's house

	//the [left,right]is existing range
	var str = readline().split(" ");
	var left = str[0], right = str[1];
	// var left = array[0][0],right = array[0][1];
	// console.log(left, right);
	var result = true;
	for(var i = 1; i < n; i++){
		var array = readline().split(" ");
		var a1 = left, b1 = right;
		// console.log(a1, b1);
		// var a2 = array[i][0], b2 = array[i][1];
		// console.log(a2, b2);
		var a2 = array[0],b2 = array[1];
		if(a1 <= a2){
			left = a1;
			if(a2 <= b1){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else{
				result = false;
			}
		}
		else {
			left = a2;
			if(a1 <= b2){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else result = false;
		}
	}
	var ans;
	if(result){
		if(left === 0 && right === m)
			ans = 'YES';
		else ans = 'NO';
	}
	else ans = 'NO';
	return ans;
}
print(f(n, m));
// console.log(f(2,1));

// write by lpy in 2017/12/21
//title is Visting a Friend
/*
	the input of this argument
*/
var arr = readline().split(" ");
var n = arr[0];
var m = arr[1];

// var array = [[1,1],[0,0]];

function f(n,m){// n is the number of input, m is the friend's house

	//the [left,right]is existing range
	var str = readline().split(" ");
	var left = str[0], right = str[1];
	// var left = array[0][0],right = array[0][1];
	// console.log(left, right);
	var result = true;
	for(var i = 1; i < n; i++){
		var array = readline().split(" ");
		var a1 = left, b1 = right;
		// console.log(a1, b1);
		// var a2 = array[i][0], b2 = array[i][1];
		// console.log(a2, b2);
		var a2 = array[0],b2 = array[1];
		if(a1 <= a2){
			left = a1;
			if(a2 <= b1){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else{
				result = false;
			}
		}
		else {
			left = a2;
			if(a1 <= b2){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else result = false;
		}
	}
	var ans;
	if(result===true){
		if(left === 0 && right === m)
			ans = 'YES';
		else ans = 'NO';
	}
	else ans = 'NO';
	return ans;
}
print(f(n, m));
// console.log(f(2,1));

// write by lpy in 2017/12/21
//title is Visting a Friend
/*
	the input of this argument
*/
var arr = readline().split(" ");
var n = arr[0];
var m = arr[1];

//var array = [[0,4],[2,6],[6,7]];

function f(n,m){// n is the number of input, m is the friend's house
	var left = 0, right = 0;
	//the [left,right]is existing range
	var result = 'YES';
	for(var i = 0; i < n; i++){
		var array = readline().split(" ");
		var a1 = left, b1 = right;
		// var a2 = array[i][0], b2 = array[i][1];
		var a2 = array[0],b2 = array[1];
		if(a1 <= a2){
			left = a1;
			if(a2 <= b1){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else{
				result = 'NO';
			}
		}
		else {
			left = a2;
			if(a1 <= b2){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else result = 'NO';
		}
	}
	return result;
}
print(f(n, m));
// console.log(f(3,5));

var read = +readline().split(" ");
var loop = read[0];
var limit = read[1];
var reject = false;
var lst = 0;
function getPt( loop, limit ){
				 while( loop ){
					 	loop--;
						var arr = +readline().split(" ");
						x = arr[0],y = arr[1];
						if ( x > lst ){
	    					   reject = true;
						   	   break;
						}
						if ( y > lst )
							   lst = y;
				 }
				 if(reject)
				 	    write("NO\n");

				 return lst;
}

write(getPt(loop, limit));

var read = +readline().split(" ");
var loop = read[0];
var limit = read[1];
var lst = 0;
function getPt( loop, limit ){
				 while( loop ){
					 			loop--;
								var arr = +readline().split(" ");
								var x = arr[0];
								var y = arr[1];
								if ( x > lst )
											 break;
								if ( y > lst )
											 lst = y;

				 }

					 					if(lst == limit)
													 write("YES\n");
										else
													write("NO\n");
}
getPt( loop, limit);

var read = readline().split(" ").map(Number);
var loop = read[0];
var limit = read[1];
var lst = 0;
function getPt( loop, limit ){
				 while( loop ){
					 			loop--;
								var arr = readline().split(" ").map(Number);
								var x = arr[0];
								var y = arr[1];
								if ( x > lst )
											 break;
								if ( y > lst )
											 lst = y;

				 }

					 					if(lst == limit)
													 write(lst);
										else
													write(lst);
}
getPt( loop, limit);

var read = +readline().split(" ");
var loop = read[0];
var limit = read[1];
var reject = false;
var found = false;
var lst = 0;
var x;
var y;
getPt( loop, limit );
function getPt( loop, limit ){
				 while( loop ){
					 			loop--;
								var arr = +readline().split(" ");
								x = arr[0],y = arr[1];
								if ( x > lst ){
											 reject = true;
											 break;
								}
								if ( y > lst ){
											 lst = y;
											 if( lst == limit ){
												 			 found = true;
															 break;
											 }
								}

				 }
				 if(reject)
				 			 write("NO\n");
				 if(found)
				 			 write("YES\n");
				 if(!reject && !found)
							 write(lst = limit ? "YES" : "NO");
}

var read = +readline().split(" ");
var loop = read[0];
var limit = read[1];
var reject = false;
var found = false;
var lst = 0;
function getPt( loop, limit ){
				 while( loop ){
					 			loop--;
								var arr = +readline().split(" ");
								x = arr[0],y = arr[1];
								if ( x > lst ){
											 reject = true;
											 break;
								}
								if ( y > lst ){
											 lst = y;
											 if( lst == limit ){
												 			 found = true;
															 break;
											 }
								}

				 }
				 if(reject)
				 			 write("NO\n");
				 if(found)
				 			 write("YES\n");
				 if(!reject && !found)
				 return lst;
}
var result = getPt(loop, limit);
write(result == limit ? "YES" : "NO");

var read = +readline().split(" ");
var loop = read[0];
var limit = read[1];
var lst = 0;
function getPt( loop, limit ){
				 while( loop ){
					 			loop--;
								var arr = +readline().split(" ");
								var x = arr[0];
								var y = arr[1];
								if ( x > lst )
											 break;
								if ( y > lst )
											 lst = y;

				 }

					 					if(lst == limit)
													 write(lst);
										else
													write(lst);
}
getPt( loop, limit);

var read = +readline().split(" ");
var loop = read[0];
var limit = read[1];
var reject = false;
var found = false;
var lst = 0;
getPt( loop, limit );
function getPt( loop, limit ){
				 while( loop ){
					 			loop--;
								var arr = +readline().split(" ");
								x = arr[0],y = arr[1];
								if ( x > lst ){
											 reject = true;
											 break;
								}
								if ( y > lst ){
											 lst = y;
											 if( lst == limit ){
												 			 found = true;
															 break;
											 }
								}

				 }
				 if(reject)
				 			 write("NO\n");
				 if(found)
				 			 write("YES\n");
				 if(!reject && !found)
							 write(lst = limit ? "YES" : "NO");
}

var read = +readline().split(" ");
var loop = read[0];
var limit = read[1];
var reject = false;
var found = false;
var lst = 0;
while( loop ){
			 loop--;
		   var arr = +readline().split(" ");
			 x = arr[0],y = arr[1];
			 if ( x > lst ){
				   		reject = true;
							break;
				}
				if ( y > lst ){
							lst = y;
							if( lst == limit ){
									    found = true;
										  break;
											}
							}

				 }
if(reject)
			write("NO\n");
if(found)
			 write("YES\n");
if(!reject && !found)
					 write(lst = limit ? "YES" : "NO");

var read = +readline().split(" ");
var loop = read[0];
var limit = read[1];
var lst = 0;
getPt( loop, limit);
function getPt( loop, limit ){
				 while( loop ){
					 			loop--;
								var arr = +readline().split(" ");
								var x = arr[0];
								var y = arr[1];
								if ( x > lst ){
											 break;
								}
								if ( y > lst ){
											 lst = y;
								}

				 }

					 					if(lst == limit)
													 write("YES\n");
										else
													write("NO\n");
}

var read = +readline().split(" ");
var loop = read[0];
var limit = read[1];
var reject = false;
var found = false;
var lst = 0;
getPt( loop, limit);
function getPt( loop, limit ){
				 while( loop ){
					 			loop--;
								var arr = +readline().split(" ");
								var x = arr[0];var y = arr[1];
								if ( x > lst ){
											 reject = true;
											 break;
								}
								if ( y > lst ){
											 lst = y;
											 if( lst == limit ){
												 			 found = true;
															 break;
											 }
								}

				 }
				 if(reject)
				 			 write("NO\n");
				 if(found)
				 			 write("YES\n");
				 if(!reject && !found){
					 					if(lst == limit)
													 write("YES\n");
										else
													write("NO\n");
				 }
}

var line = readline().split(' ');
var N = parseInt(line[0]);
var M = parseInt(line[1]);
var a = [], b=[];

for(var i = 0; i < N; i++) {
	var line = readline().split(' ');
	a[i] = parseInt(line[0]);
	b[i] = parseInt(line[1]);
}

var left = 0;

for(var i=0;i<N;i++){
	if(a[i]<=left){
		left = b[i];
	}
}

if(M <= left){
	print("YES");
}else{
	print("NO");
}

one=readline();
n=parseInt(one.split(' ')[0]);
m=parseInt(one.split(' ')[1]);
mas=[];
function compareNumeric(x, y) {
  if (x.a > y.a) return 1;
  if (x.a < y.a) return -1;
}
for(i=0;i<n;i++) {
    one=readline();
    mas[i]={};
    mas[i].a = parseInt(one.split(' ')[0]);
    mas[i].b = parseInt(one.split(' ')[1]);
}
mas.sort(compareNumeric);
max=0;
for(i=0;i<n;i++) {
    if(mas[i].a <= max) {
       if(mas[i].b > max) {
           max = mas[i].b;
           if (max >= m) {
               print('YES');
           }
       }
    }
}
print('NO');

one=readline();
n=parseInt(one.split(' ')[0]);
m=parseInt(one.split(' ')[1]);
mas=[];
function compareNumeric(x, y) {
  if (x.a > y.a) return 1;
  if (x.a < y.a) return -1;
}
for(i=0;i<n;i++) {
    one=readline();
    mas[i]={};
    mas[i].a = parseInt(one.split(' ')[0]);
    mas[i].b = parseInt(one.split(' ')[1]);
}
mas.sort(compareNumeric);
max=0;
for(i=0;i<n;i++) {
    if(mas[i].a <= max) {
       if(mas[i].b > max) {
           max = mas[i].b;
           if (max >= m) {
               print('YES');
           }
       }
    } else {
       print('NO');
    }
}

one=readline();
n=parseInt(one.split(' ')[0]);
m=parseInt(one.split(' ')[1]);
mas=[];
function compareNumeric(x, y) {
  if (x.a > y.a) return 1;
  if (x.a < y.a) return -1;
  if (x.a === y.a) {
    if (x.b > y.b) return 1;
    if (x.b < y.b) return -1;
  }
}
for(i=0;i<n;i++) {
    one=readline();
    mas[i]={};
    mas[i].a = parseInt(one.split(' ')[0]);
    mas[i].b = parseInt(one.split(' ')[1]);
}
mas.sort(compareNumeric);
max=0;
for(i=0;i<n;i++) {
    if(mas[i].a <= max) {
       if(mas[i].b > max) {
           max = mas[i].b;
           if (max >= m) {
               print('YES');
               break;
           }
       }
    } else {
       print('NO');
       break;
    }
}
if (max < m) {print('NO');}

one=readline();
n=parseInt(one.split(' ')[0]);
m=parseInt(one.split(' ')[1]);
mas=[];
function compareNumeric(x, y) {
  if (x.a > y.a) return 1;
  if (x.a < y.a) return -1;
  if (x.a === y.a) {
    if (x.b > y.b) return 1;
    if (x.b < y.b) return -1;
  }
}
for(i=0;i<n;i++) {
    one=readline();
    mas[i]={};
    mas[i].a = parseInt(one.split(' ')[0]);
    mas[i].b = parseInt(one.split(' ')[1]);
}
mas.sort(compareNumeric);
max=0;
for(i=0;i<n;i++) {
    if(mas[i].a <= max) {
       if(mas[i].b > max) {
           max = mas[i].b;
           if (max >= m) {
               print('YES');
           }
       }
    } else {
       print('NO');
    }
}

// write by lpy in 2017/12/21
//title is Visting a Friend
/*
	the input of this argument
*/
var arr = readline().split(" ");
var n = arr[0];
var m = arr[1];

//var array = [[0,4],[2,6],[6,7]];

function f(n,m){// n is the number of input, m is the friend's house

	//the [left,right]is existing range
	var str = readline().split(" ");
	var left = str[0], right = str[1];
	var result = true;
	for(var i = 1; i < n; i++){
		var array = readline().split(" ");
		var a1 = left, b1 = right;
		// var a2 = array[i][0], b2 = array[i][1];
		var a2 = array[0],b2 = array[1];
		if(a1 <= a2){
			left = a1;
			if(a2 <= b1){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else{
				result = false;
			}
		}
		else {
			left = a2;
			if(a1 <= b2){
				if(b1 <= b2){
					right = b2;
				}
				else right = b1;
			}
			else result = false;
		}
	}
	var ans;
	if(left === 0 && right === m)
		ans = 'YES';
	else ans = 'NO';
	return ans;
}
print(f(n, m));
// console.log(f(3,5));


const readline = require('readline')

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

let n, p, numLines = 0
rl.on('line', line => {
    if (++numLines == 1) {
        n = parseInt(line)
    } else {
        (p = line.split(' ').map(x => parseInt(x))).unshift(0)
    }
}).on('close', () => {
    let caughtStudent = (id) => {
        let visited = []
        let dfs = u => {
            visited[u] = true
            if (!visited[p[u]]) {
                return dfs(p[u])
            } else {
                return p[u]
            }
        }
        return dfs(id)
    }
    process.stdout.write(`${[...Array(n + 1).keys()].slice(1).map(x => caughtStudent(x)).join(' ')}\n`)
})

function main() {
  const is = new Scanner();
  const n = is.nextInt();
  const reported = is.nextArray(Number);
  reported.unshift(null);
  const container = new Array(n + 1);
  let current;
  for (let i = 1; i <= n; i += 1) {
    container.fill(0);
    current = i;
    container[current] += 1;
    while (container[current] !== 2) {
      current = reported[current];
      container[current] += 1;
    }
    process.stdout.write(`${current.toString()} `);
  }
  console.log();
}

/*
 *  Api Scanner
 */
class Scanner {
  constructor() {
    this.index = -1;
    this.lines = stdinInput.trim().split('\n'); // eslint-disable-line
  }

  nextLine() {
    this.index += 1;
    return this.lines[this.index].trim();
  }

  nextInt() {
    return parseInt(this.nextLine(), 10);
  }

  nextDouble() {
    return parseFloat(this.nextLine());
  }

  nextArray(fn) {
    const array = this.nextLine().split(' ');
    return fn === String ? array : array.map(fn);
  }

  hasNext() {
    return this.index < this.lines.length;
  }
}

let stdinInput = '';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', (input) => { stdinInput += input; });
process.stdin.on('end', () => { main(); });

var n = readline();
var students = readline().split(' ');
var rst = [];
function solve() {
    for (var m = 0; m < students.length; m++) {
        var set = {};
        var current = m;
        while (true) {
            set[current] = set[current] ? set[current] + 1 : 1;
            if (set[current] === 2) {
                rst.push(current + 1);
                break;
            }
            current = students[current] - 1;
        }
    }
    return rst;
}
print(solve().join(' '));
// console.log(solve())

var visited = {};

function dfs(cur) {
  visited[cur] = true;
  var stu = students[cur] - 1;
  return visited[stu] ? stu + 1 : dfs(stu);
}

function solve() {
  var res = [];
  for (var i = 0; i < n; i++) {
    visited = {};
    res[i] = dfs(i);
  }
  return res;
}

var n = readline();
var students = readline().split(' ');
print(solve().join(' '));

var cnt = {};

function dfs(cur) {
  if (cnt[cur] > 1) {
    return cur;
  }
  cnt[cur] = cnt[cur] ? 2 : 1;
  return dfs(students[cur - 1]);
}

function solve() {
  var res = [];
  for (var i = 0; i<n; i++) {
    cnt = {};
    cnt[i + 1] = 1;
    res[i] = dfs(students[i]);
  }
  return res;
}

var n = readline();
var students = readline().split(' ');
print(solve().join(' '));

var n = readline();
var students = readline().split(' ');
var rst = [];
function solve() {
    for (var m = 0; m < students.length; m++) {
        var set = {};
        var current = m;
        while (true) {
            set[current] = set[current] ? set[current] + 1 : 1;
            if (set[current] === 2) {
                rst.push(current);
                break;
            }
            current = students[current];
        }
    }
    return rst;
}
print(solve().join(' '));

var n = readline();
var students = readline();

print(n);

var cnt = {};

function dfs(cur) {
  if (cnt[cur] > 1) {
    return cur;
  }
  cnt[cur] = cnt[cur] ? 2 : 1;
  return dfs(students[cur - 1]);
}

function solve() {
  var res = [];
  for (var i = 0; i<n; i++) {
    cnt = {};
    cnt[i + 1] = 1;
    res[i] = dfs(students[i]);
  }
  return res;
}

var n = readline();
var students = readline().split(' ');
print(solve());