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];
    for(var l = 1; l <= n; l++){
        var a = 2;
        var b = a - 1;
        var answer = '';
        var k = lines[l];
        if(k % 2 === 0){
            for(var j = 0; j < k / 2; j++){
                answer += a + ' ' + b + ' ';
                a += 2;
                b = a - 1;
            }
        }else{
            answer = 3 + ' ' + 1 + ' ' + 2 + ' ';
            a = 5;
            b = 0;
            for(var h = 3; h < k; h++){
                if(b % 2 === 0){
                    answer += a + ' ';
                    b = 1;
                }else{
                    answer += a - 1 + ' ';
                    b = 0;
                    a += 2;
                }
            }
        }
        console.log(answer);
    }
});

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 () => {
    const nsc = parseInt(await getLine());
    for(let sc = 0; sc < nsc; sc++) {
        const n = parseInt(await getLine());
        if (n === 1) {
            rl.output.write(1+ '\n');
            continue;
        }

        if (n%2 === 0) {
            for(let i = 1; i <= n; i += 2) {
               if (i > 1)
                   rl.output.write(' ');
               rl.output.write((i+1) + ' ' + i);
            }
            rl.output.write('\n');
        } else {
            for(let i = 1; i <= n - 3; i += 2) {
                if (i > 1)
                    rl.output.write(' ');
                rl.output.write((i+1) + ' ' + i);
            }
            if (n > 3)
                rl.output.write(' ');
            rl.output.write(n + ' ' + (n - 2) + ' ' + (n - 1) + '\n');
        }
    }

}

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) => {
                    const num = parseInt(str);
                    console.log(prettyPermutations(num));
          });
})

const prettyPermutations = (num) => {
          let ans = new Array(num).fill(0);
          ans = ans.map((_, i) => i + 1);
          for (let i = 1; i < num; i++) {
                    if (i % 2 === 1 || i === num - 1) [ans[i - 1], ans[i]] = [ans[i], [ans[i - 1]]];
          }
          return ans.join(' ');
}

let data = '';
process.stdin.on('data', c => data += c);

function* nextLine() {
	let lines = data.trim().split(/\n/g);
	for(let l of lines){
		yield l.trim();
	}
}

let nl = nextLine();

nl.elem = function(funParse) {
		return funParse(this.next().value);
	};

nl.array = function(funParse) {
		return this.next().value.split(/\s/g).map(funParse||(x => x));
	};

nl.num = function() {
		return nl.elem(Number);
	};

nl.nums = function() {
		return nl.array(Number);
	};

nl.line = function() {
		return this.next().value;
	};

const sol = () => {
	//your code this
	let t = nl.num();
	let ans = [];
	for(let i = 0; i < t; i++){
		let n = nl.num();
		let r = [];
		for(let j = 0; j < n - n%2; j += 2){
			r.push(j + 2);
			r.push(j + 1);
		}
		if (n%2 === 1){
			r.push(n);
			[r[n-1] , r[n-2]] = [r[n-2], r[n-1]];
		}
		ans.push(r);
	}
	console.log(ans.map(e => e.join(' ')).join('\n'));
};

process.stdin.on('end', sol);

var t = parseInt(readline());
while (t--) {
    var n = parseInt(readline());
    if (n % 2 === 0) {
        for (var i = 1; i < n; i += 2) write(i + 1 + ' ' + i + ' ');
        write('\n');
    } else {
        write('3 1 2 ');
        for (var i = 4; i < n; i += 2) write(i + 1 + ' ' + i + ' ');
        write('\n');
    }
}

var t = parseInt(readline());
while (t--) {
    var n = parseInt(readline());
    if (n % 2 == 0) {
        for (var i = 1; i < n; i += 2) write(i + 1 + ' ' + i + ' ');
        write('\n');
    } else {
        write('3 1 2 ');
        for (var i = 4; i < n; i += 2) write(i + 1 + ' ' + i + ' ');
        write('\n');
    }
}

var t = parseInt(readline());
while (t--) {
    var n = parseInt(readline());
    if (n % 2 == 0) {
        for (var i = 1; i < n; i += 2) write(i + 1 + ' ' + i + ' ');
    } else {
        write('3 1 2 ');
        for (var i = 4; i < n; i += 2) write(i + 1 + ' ' + i + ' ');
    }
}

var t = parseInt(readline());
while(t--) {
    var n = parseInt(readline());
    if(n%2 == 0) {
        for(var i=1; i<n; i+=2) write(i+1 +' '+ i +' ');
        print();
    }
    else {
        write('3 1 2 ');
        for(var i=4; i<n; i+= 2) write(i+1 +' '+ i +' ');
        print();
    }
}

var t = parseInt(readline());
while(t--) {
    var n = parseInt(readline());
    if(n%2 == 0) {
        for(var i=1; i<n; i+=2) write(i+1 +' '+ i +' ');
    }
    else {
        write('3 1 2 ');
        for(var i=4; i<n; i+= 2) write(i+1 +' '+ i +' ');
    }
}

var t = parseInt(readline());
while(t--) {
    var n = parseInt(readline());
    if(n%2 === 0) {
        for(var i=1; i<n; i+=2) write(i+1 +' '+ i +' ');
    }
    else {
        write('3 1 2 ');
        for(var i=4; i<n; i+= 2) write(i+1 +' '+ i +' ');
    }
}

"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");

function print(x) {
  console.log(x);
}
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++];
}

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

function main() {

    var t = parseInt(readline());
    while(t--) {
        var n = parseInt(readline());
        if(n%2 == 0) {
            for(var i=1; i<n; i+=2) print(i+1 +' '+ i +' ');
        }
        else {
            print('3 1 2 ');
            for(var i=4; i<n; i+= 2) print(i+1 +' '+ i +' ');
        }
    }

}

//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 list = [];
		for(var i = 1; i <= N; i++){
			list.push(i);
		}
		for(var i = 0; i < N - 1; i += 2){
			var tmp = list[i];
			list[i] = list[i + 1];
			list[i + 1] = tmp;
		}
		if(N % 2 == 1){
			var tmp = list[N - 2];
			list[N - 2] = list[N - 1];
			list[N - 1] = tmp;
		}
		myout(myconv(list, 8));
	}
}

function gcd(x, y) {
   if (y === 0) {
      return x;
   }
   return gcd(y, x % y);
}

function div(a, b) {
   return Math.floor(a / b);
}

function solve() {
   var n = Number(read());
   arr = []
   for (var i = 1; i < n; i++) {
      if (i & 1) {
         arr.push(i + 1);
         continue;
      }
      arr.push(i - 1);
   }
   if (n & 1) {
      arr.push(arr[n - 2]);
      arr[n - 2] = n;
   } else {
      arr.push(n - 1);
   }
   write(arr.join(' '));
}

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

function sortF(a, b) {
   if (a < b) {
      return -1;
   }
   if (a > b) {
      return 1;
   }
   return 0;
}

function readArray(f) {
   return read().split(' ').map(f);
}

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;

   var needWriteFile = false;

   var writeResult = '';
   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();
         if (needWriteFile) {
            fs.writeFile(path.join(__dirname, outTextName), writeResult, (err) => {
               err ? console.error(err) : console.log('good')
            });
         }
      });
   } else {
      MEMORY = fs.readFileSync(0, 'utf-8').split('\r\n');
      init();
   }
} else {
   init();
}

function write(value) {
   if (needWriteFile) {
      writeResult += value + '\n';
      return;
   }
   isNode ? console.log('' + value) : print('' + value);
}
function read() {
   return isNode ? MEMORY[MEMORY_INDEX++] : readline();
}
function readAll() {
   return isNode && MEMORY;
}

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++]
        console.log(solve(n));
    }
});

function solve(n) {
    const r = []
    let start = 1
    if (n & 1) {
        r[1] = 3
        r[2] = 1
        r[3] = 2
        start = 4
    }
    for (let i = start; i <= n; i++) {
        r[i] = ((i - start) & 1) ? i - 1 : i + 1
    }
    r.shift() // 0
    return r.join(' ')
}

var t = parseInt(readline());
var i = 1;
while (t--) {
    var n = parseInt(readline());
    if (n % 2 === 1) {
        write('3 1 2 ');
        i = 4;
    }

    for (; i < n; i += 2) write(i + 1 + ' ' + i + ' ');
    write('\n');
}

var t = parseInt(readline());
while (t--) {
    const n = parseInt(readline());
    if (n % 2 == 0) {
        for (var i = 1; i < n; i += 2) write(i + 1 + ' ' + i + ' ');
    } else {
        write('3 1 2 ');
        for (var i = 4; i < n; i += 2) write(i + 1 + ' ' + i + ' ');
    }
}

var t = parseInt(readline());
while(t--) {
    var n = parseInt(readline());
    write(n+' ');
    for(var i=1; i<n; i++) write(i+' ');
    print()
}

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];
    for(j = 1; j <= n; j ++){
        var s = []
        var d = ''
        for(k = 1; k <= lines[j]; k++){
            s.push(k)
        }
        s = s.sort(function(a, b){return b - a});
        d += s[0] + ' '
        s = s.sort(function(a, b){return a - b});

        for(l = 0; l < s.length - 1; l++){
            d += s[l] + ' '
        }
        console.log(d)
    }

});

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];
    for(j = 1; j <= n; j ++){
        var s = []
        var d = ''
        for(k = 1; k <= lines[j]; k++){
            s.push(k)
        }
        s.sort(function(a, b){return b - a});
        d += s[0]
        for(l = 0; l <= s.length; l++){
            d += s[l]
        }
        console.log(d)
    }

});

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];
    for(j = 1; j <= n; j ++){
        var s = ''
        for(k = 1; k <= lines[j]; k++){
            s += k + ' '
        }
        console.log(s)
    }

});

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];
    for(j = 1; j <= n; j ++){
        var s = ''
        for(k = 0; k < lines[j]; k++){
            s += k + ''
        }
        console.log(s)
    }

});

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];

    for(j = 1; j <= n;j ++){
        var a = lines[j].split(' ').map(Number)
        console.log((a[1] + a[0]))
    }
});

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];
    for(var l = 1; l <= n; l++){
        var a = 2;
        var b = a - 1;
        var answer = '';
        var k = lines[l];
        if(k % 2 === 0){
            for(var j = 0; j < k / 2; j++){
                answer += a + ' ' + b + ' ';
                a += 2;
                b = a - 1;
            }
        }else{
            answer = 3 + ' ' + 1 + ' ' + 2 + ' ';
            a = 5;
            b = 0;
            for(var h = 3; h < k; h++){
                if(b % 2 === 0){
                    answer += a + ' ';
                    b = 1;
                }else{
                    answer += a - 1 + ' ';
                    b = 0;
                    a += 3;
                }
            }
        }
        console.log(answer);
    }
});

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];
    console.log(2 + ' ' + 1 + "\n" + 3 + ' ' + 1 + ' ' + 2)
});

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];
    console.log(2 + ' ' + 3 + "\n" + 3 + ' ' + 1 + ' ' + 2)
});

"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");

function print(x) {
  console.log(x);
}
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++];
}

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

function main() {

    var t = parseInt(readline());
    while(t--) {
        var n = parseInt(readline());
        if(n%2 == 0) {
            for(var i=1; i<n; i+=2) print(i+1 +' '+ i +' ');
            print();
        }
        else {
            print('3 1 2 ');
            for(var i=4; i<n; i+= 2) print(i+1 +' '+ i +' ');
            print();
        }
    }

}

//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 list = [];
		for(var i = 1; i <= N; i++){
			list.push(i);
		}
		var tmp = list.pop();
		list.unshift(tmp);
		myout(myconv(list, 8));
	}
}

function gcd(x, y) {
   if (y === 0) {
      return x;
   }
   return gcd(y, x % y);
}

function div(a, b) {
   return Math.floor(a / b);
}

function solve() {
   var n = Number(read());
   var arr = [n];
   for (var i = 1; i < n; i++) arr.push(i);
   write(arr.join(' '));
}

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

function sortF(a, b) {
   if (a < b) {
      return -1;
   }
   if (a > b) {
      return 1;
   }
   return 0;
}

function readArray(f) {
   return read().split(' ').map(f);
}

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;

   var needWriteFile = false;

   var writeResult = '';
   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();
         if (needWriteFile) {
            fs.writeFile(path.join(__dirname, outTextName), writeResult, (err) => {
               err ? console.error(err) : console.log('good')
            });
         }
      });
   } else {
      MEMORY = fs.readFileSync(0, 'utf-8').split('\r\n');
      init();
   }
} else {
   init();
}

function write(value) {
   if (needWriteFile) {
      writeResult += value + '\n';
      return;
   }
   isNode ? console.log('' + value) : print('' + value);
}
function read() {
   return isNode ? MEMORY[MEMORY_INDEX++] : readline();
}
function readAll() {
   return isNode && MEMORY;
}

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++]
        console.log(solve(n));
    }
});

function solve(n) {
    const r = []
    let start = 1
    if (n & 1) {
        r[1] = 3
        r[2] = 2
        r[3] = 1
        start = 4
    }
    for (let i = start; i <= n; i++) {
        r[i] = ((i - start) & 1) ? i - 1 : i + 1
    }
    r.shift() // 0
    return r.join(' ')
}

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 () => {
    const nsc = parseInt(await getLine());
    for(let sc = 0; sc < nsc; sc++) {
        const n = parseInt(await getLine());
        if (n === 1) {
            rl.write(1+ '\n');
            continue;
        }

        if (n%2 === 0) {
            for(let i = 1; i <= n; i += 2) {
               if (i > 1)
                   rl.write(' ');
               rl.write((i+1) + ' ' + i);
            }
            rl.write('\n');
        } else {
            for(let i = 1; i <= n - 3; i += 2) {
                if (i > 1)
                    rl.write(' ');
                rl.write((i+1) + ' ' + i);
            }
            if (n > 3)
                rl.write(' ');
            rl.write(n + ' ' + (n - 2) + ' ' + (n - 1) + '\n');
        }
    }

}

solve();


var arrayLength = parseInt(readline())
var array = readline().split(' ').map(c => parseInt(c))
if (arrayLength < 3){
	print(arrayLength)
}
else {
	var size = [2], flag = false, count = 0, ans = 0
	for (var i = 2; i < arrayLength; i++){
		if (array[i-1]+array[i-2] == array[i]){
			if (!flag){
				count += 1; flag = true
			}
			else{
				count +=1
			}
		}
		else{
			if (flag){
				flag = false
				size.push(count+2)
				count = 0
			}
		}
	}
	size.push(count+2)
	size.forEach((val) => {
		if (val > ans){
			ans = val
		}
	})
	print(ans)
}

;(function () {

    print(function (n, a) {
        if (n < 3) {
            return n;
        }

        var q = [];
        for (var i = 2; i < n; i++) {
            if (a[i] === a[i - 1] + a[i - 2]) {
                if (q.length > 0) {
                    var z = +q.slice(-1);
                    if (z !== (i - 1)) {
                        q.push('|');
                    }
                }
                q.push(i);
            }
        }
        return 2 + Math.max.apply(null, q.map(function (e) { return e === '|' ? e : '0'; }).join('').split('|').map(function (e) { return e.length; }));
    }.apply(null, [+readline(), readline().split(' ').map(Number)]));

}.call(this));

print(function(n, a) {
	var ans = 0,
		cnt = 0;
	if (a.length < 3) return a.length;
	for (var i = 0; i < n; i++)
		if (a[i] + a[i + 1] === a[i + 2]) {
			cnt++;
		} else {
			ans = Math.max(ans, cnt + 2);
			cnt = 0;
	}

	return ans;

}(+readline(), readline().split(' ').map(Number)));

print(function(n, a) {
	var ans = Math.min(a.length, 2),
		cnt = 0;
	for (var i = 0; i < n; i++)
		if (a[i] + a[i + 1] === a[i + 2]) {
			cnt++;
		} else {
			ans = Math.max(ans, cnt + 2);
			cnt = 0;
		}

	return ans;

}(+readline(), readline().split(' ').map(Number)));

print(function(n, a) {
	var ans = Math.min(2, a.length),
		cnt = ans;
	for (var i = 2; i < n; i++)
		if (a[i] === a[i - 1] + a[i - 2]) {
			cnt++;
		} else {
			ans = Math.max(ans, cnt);
			cnt = 0;
		}

	ans = Math.max(ans, cnt);
	return ans;

}(+readline(), readline().split(' ').map(Number)));

var arrayLength = parseInt(readline())
var array = readline().split(' ').map(c => parseInt(c))
if (arrayLength < 3){
	print(arrayLength)
}
else {
	var size = [2], flag = false, count = 0
	for (var i = 2; i < arrayLength; i++){
		if (array[i-1]+array[i-2] == array[i]){
			if (!flag){
				count += 1; flag = true
			}
			else{
				count +=1
			}
		}
		else{
			if (flag){
				flag = false
				size.push(count+2)
				count = 0
			}
		}
	}
	size.push(count+2)
	print(Math.max(size))
}

;(function () {

    print(function (n, a) {
        var q = [];
        for (var i = 2; i < n; i++) {
            if (a[i] === a[i - 1] + a[i - 2]) {
                if (q.length > 0) {
                    var z = +q.slice(-1);
                    if (z !== (i - 1)) {
                        q.push('|');
                    }
                }
                q.push(i);
            }
        }
        return 2 + Math.max.apply(null, q.join('').split('|').map(function (e) { return e.length; }));
    }.apply(null, [+readline(), readline().split(' ').map(Number)]));

}.call(this));

;(function () {

    print(function (n, a) {
        if (n < 3) {
            return n;
        }

        var q = [];
        for (var i = 2; i < n; i++) {
            if (a[i] === a[i - 1] + a[i - 2]) {
                if (q.length > 0) {
                    var z = +q.slice(-1);
                    if (z !== (i - 1)) {
                        q.push('|');
                    }
                }
                q.push(i);
            }
        }
        return 2 + Math.max.apply(null, q.join('').split('|').map(function (e) { return e.length; }));
    }.apply(null, [+readline(), readline().split(' ').map(Number)]));

}.call(this));


/**
 * 04/16/21 morning
 * https://codeforces.com/contest/1509/problem/A
 */

///////////////////////////////// pre-define /////////////////////////////////////
const pr = console.log;
///////////////////////////////////////////////////////////////////////////////////

const solve = (n, a) => {
    let odd = [];
    let even = [];
    for (const e of a) {
        e & 1 ? odd.push(e) : even.push(e);
    }
    let res = odd.concat(even);
    pr(res.join(" "))
};

const main = () => {
    const readline = require('readline');
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });
    let input = [];
    rl.on('line', (line) => {
        input.push(line.split(" ").map(x => Number(x)));
    });
    rl.on('close', () => {
        let t = input[0][0];
        let i = 1;
        while (t--) {
            solve(input[i][0], input[i + 1]);
            i += 2;
        }
    });
};

main()

var t = readline();
    for(var i = 0 ; i < t ; ++i){
        var n = readline(), odd = [] , even = [];
            a = readline().split(' ');
        for(var j = 0 ; j < n ; ++j){
            if(a[j] % 2 === 0){
                even.push(a[j]);
            }
            else{
                odd.push(a[j]);
            }
        }
        print(odd.join(' ') + ' ' + even.join(' '));
    }

var t = parseInt(readline());
while(t--){
    var n = parseInt(readline());
    var h = readline().split(" ").map(x => parseInt(x));
    var e = [] , o = [];
    for(var i = 0 ; i < n ; i++){
        if(h[i]&1){
            o.push(h[i]);
        } else e.push(h[i]);
    }

    var ans = "";
    e.forEach(x => ans += x+" ");
    o.forEach(x => ans += x+" ");
    print(ans);
}

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);
	var t = lines[0];
    var n = 0;
    for(i = 1; i <= t * 2; i++){
        if(i % 2 == 1){
            n = lines[i];
        }else{
            var k = lines[i].split(' ').map(Number);
            var odd = [];
            var even = [];
            for(j = 0; j < n; j++){
                if(k[j] % 2 == 1){
                    odd.push(k[j]);
                }else{
                    even.push(k[j]);
                }
            }
            var a = '';
            for(j = 0; j < odd.length; j++){
                a += odd[j] + ' ';
            }
            for(j = 0; j < even.length; j++){
                a += even[j] + ' ';
            }
            console.log(a);
        }
    }
});

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
// var lines = fs.readFileSync(0, 'utf8').split('\n');
// const io = {
//   nextLine() {},
//   nextNum() {},
// };
class IO {
    constructor() {
        this.lines = [];
        this.tokens = [];
        this.lines = fs_1.default.readFileSync(0, 'utf8').split('\n');
    }
    getTokens() {
        if (!this.tokens.length) {
            this.tokens = this.nextLine().split(' ');
        }
        return this.tokens;
    }
    nextLine() {
        return this.lines.shift();
    }
    nextNum() {
        return Number(this.getTokens().shift());
    }
    nextNumArray(n) {
        let ret = [];
        while (n--) {
            ret.push(this.nextNum());
        }
        return ret;
    }
}
const io = new IO();
function solve(n, arr) {
    arr.sort((a, b) => {
        // if (a % 2 === b % 2) {
        //   return 0 ;
        // }
        return (a % 2) - (b % 2);
    });
    console.log(arr.join(' '));
}
function main() {
    let t = io.nextNum();
    while (t--) {
        let n = io.nextNum();
        let arr = io.nextNumArray(n);
        solve(n, arr);
    }
}
main();

'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(data.shift());

    while(testCases--) {

        const n = parseInt(readLine());

        const a = readLine().split(' ').map(Number);

        let res = [];

        let odd = [];
        let even = [];

        for(let i = 0; i < n; i++){
            if(a[i] % 2 === 0) even.push(a[i])
            else odd.push(a[i])
        }
        if(even.length >= odd.length){
            for(let i =0 ; i < even.length ; i++){
                res.push(even[i]);
            }
            for(let i = 0;i < odd.length; i++){
                res.push(odd[i]);
            }
        }
        else {
            for(let i = 0;i < odd.length; i++){
                res.push(odd[i]);
            }
            for(let i =0 ; i < even.length ; i++){
                res.push(even[i]);
            }
        }
        console.log(res.join(' '));
    }
});

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

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

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 * 2
    } 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([n], arr) {
    const even = arr.filter(i => i % 2 === 0)
    const notEven = arr.filter(i => i % 2 !== 0)
    // if (even.length % 2 !== 0) {
    //     const def = even.pop()
    //     notEven.push(def)
    // }
    console.log(notEven.concat(even).join(' '))
}

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

let input = '';
process.stdin.on('data', str => input += str)
process.stdin.on('end', () => {
	const lines = input.trim().split('\n').slice(1);

	for (let i=1; i<lines.length; i+=2) {
		const arr = lines[i].trim().split(' ')
			.map(v => +v)

		const odd = [];
		const even = [];

		for (let j=0; j<arr.length; j++) {
			if (arr[j]%2 === 0) {
				even.push(arr[j]);
			} else {
				odd.push(arr[j]);
			}
		}

		console.log(odd.concat(even).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++];
}

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() {
  const xx = readline();
  Array(Number(xx)).fill(1).map((t, i) => {
    var n = parseInt(readline());
    // var [n, k] = readline().split(' ').map((x, iii) => {
    //   return parseInt(x)
    // })
    var a = readline().split(' ').map((x, iii) => {
      return parseInt(x)
    });
    var ans = []

    for (let j = 0; j < n; j++) {
      if (a[j] % 2 === 0) ans.push(a[j])
    }
    var ans2 = []

    for (let j = 0; j < n; j++) {
      if (a[j] % 2 === 1) ans2.push(a[j])
    }

    console.log(ans.concat(ans2).join(' '))
  })
}

//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 N = nextInt();
		var list = nextIntArray(N);
		var output = [];
		for(var j = 0; j < N; j++){
			if(list[j] % 2 == 0){
				output.push(list[j]);
			}
		}
		for(var j = 0; j < N; j++){
			if(list[j] % 2 == 1){
				output.push(list[j]);
			}
		}
		myout(myconv(output, 8));
	}
}

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);
	var t = lines[0];
    var ans = 0;
    while(t !== 0 && t != 1){
        if(t % 2 == 1){
            ans++;
        }
        t = Math.floor(t / 2);
    }
    console.log(ans+1);
});

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];
    var e = 0;
    for(var j = 1; j <= n * 2; j++){
        if(j % 2 == 1){
            e = lines[j];
        }else{
            var k = lines[j].split(' ').map(Number).sort(function(a, b){return b - a});
            var answer = '';
            for(var l = 0; l < e; l++){
                answer += k[l] + ' ';
            }
            console.log(answer);
        }
    }
});


process.stdin.resume();
process.stdin.setEncoding('utf-8')
let inputString = '';
let currentLine = 0;
process.stdin.on('data', input => { inputString += input })
process.stdin.on('end', _ => { inputString = inputString.trim().split('\n').map(str => str.trim()); main() })
const readline = () => { return inputString[currentLine++] }

function main(){
	let tests = parseInt(readline());
	for(let i = 0; i < tests; i++){
		let num = parseInt(readline());
		let inputArr = readline().split(' ').map(x => parseInt(x));
		let mx = Math.max(...inputArr);
		let freq = new Array(mx + 1).fill(null).map(x => new Array(0));
		//for(let i = 0; i <= mx; i++) freq[i] = new Array(0);
		let yes = false;
		for(let j = 0; j < num; j++){
			let x = inputArr[j];
			freq[x].push(j);
			if(freq[x].length >= 2){
				let first = freq[x][0];
				let last = freq[x][freq[x].length - 1];
				if(last - first > 1){
					console.log("YES");
					yes = true;
					break;
				}
			}
		}
		if(!yes){
			console.log("NO");
		}
	}
}

'use strict'

const getLine = () => readline().split(' ')
const getInts = () => getLine().map(n => parseInt(n))
const getInt = () => getInts()[0]
const D = (...args) => { // D({name})
  [...args].forEach(cur => print.apply(print, [JSON.stringify(cur)]))
}

main()
function main() {
  let t = getInt()
  while (t --> 0) {
    const n = getInt()
    const arr = getInts()

    let ok = false
    const freq = {}
    for (let i = 0; i < n; ++i) {
      if (Object.hasOwnProperty.call(freq, arr[i])) {
        if (i - freq[arr[i]] > 1) {
          ok = true
          break
        }
      } else {
        freq[arr[i]] = i
      }
    }
    print(ok ? 'YES' : 'NO')
  }
}

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

let arr = ''
let ptr = 0
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) {
  return parseInt(a[ptr++])
}

function readString(a) {
  return a[ptr++]
}

function readStrings(a) {
  return a[ptr++].split(' ')
}

function readInts(a) {
  return a[ptr++].split(' ').map(a => parseInt(a))
}

function main(input) {
  let t = readInt(input)
  while(t--) {
    const n = readInt(input)
    const a = readInts(input)
    let ft = {}
    let lt = {}
    for(let i = 0; i < n; i++){
      if(!ft[a[i]]) {
        ft[a[i]] = i + 1
        lt[a[i]] = i + 1
      }
      else lt[a[i]] = i + 1
    }
    let f = false
    for(let i = 0; i < n && !f; i++){
      if(lt[a[i]]-ft[a[i]]>=2){
        f = true
      }
    }
    if(f) wr('YES')
    else wr('NO')
  }
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var nums = readline().split(' ').map(Number);
  var map = {}
  var result = ''
  for (var i = 0; i < nums.length; i++) {
    var num = nums[i];
    if (!map[num]) map[num] = {count: 0, last: i}
    map[num].count++
    if (map[num].count > 2 || map[num].last + 1 < i) {
      result = 'YES'
      break
    }
    map[num].last = i
  }
  print(result || '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 n = nextInt();
        var list = nextIntArray();
        var isOK = false;
        //odd
        for(var j = 1; j < n - 1; j++){
            var L = new Set();
            var R = new Set();
            for(var k = 0; k < j; k++){
                L.add(list[k]);
            }
            for(var k = j + 1; k < n; k++){
                if(L.has(list[k])){
                    isOK = true;
                    break;
                }
            }
        }

        if(isOK){
            output[i] = "YES";
        }else{
            output[i] = "NO";
        }
    }
    myout(myconv(output,9));
}

function isRotate(list){
    var len = list.length;
    var is = true;
    for(var i = 0; i < len; i++){
        if(list[i] != list[len - i - 1]){
            is = false;
        }
    }
    return is;
}

'use strict'

const getLine = () => readline().split(' ')
const getInts = () => getLine().map(n => parseInt(n))
const getInt = () => getInts()[0]
const D = (...args) => { // D({name})
  [...args].forEach(cur => print.apply(print, [JSON.stringify(cur)]))
}

main()
function main() {
  let t = getInt()
  while (t --> 0) {
    const n = getInt()
    const arr = getInts()

    let ok = false
    const freq = {}
    for (let i = 0; i < n; ++i) {
      if (Object.hasOwnProperty.call(freq, arr[i])) {
        if (i - freq[arr[i]] > 1) {
          ok = true
          break
        }
      }
      freq[arr[i]] = i
    }
    print(ok ? 'YES' : '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 n = nextInt();
        var list = nextIntArray();
        var isOK = false;
        for(var j = 3; j <= 4; j++){//select chars(3~)
            if(isOK){
                break;
            }
            var tmp = new Array(j);
            for(var k = 0; k < j; k++){
                tmp[k] = list[k];
            }
            for(var k = 0; k < n - j + 1; k++){
                if(k != 0){
                    tmp.shift();
                    tmp.push(list[k + j]);
                }
                var ok = isRotate(tmp);
                if(ok){
                    isOK = true;
                    break;
                }
            }
        }
        if(isOK){
            output[i] = "YES";
        }else{
            output[i] = "NO";
        }
    }
    myout(myconv(output,9));
}

function isRotate(list){
    var len = list.length;
    var is = true;
    for(var i = 0; i < Math.ceil(len / 2); i++){
        if(list[i] != list[len - i - 1]){
            is = false;
        }
    }
    return is;
}

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 n = nextInt();
        var list = nextIntArray();
        var isOK = false;
        //odd
        for(var j = 1; j < n - 1; j++){
            var tmp = [list[j - 1], list[j], list[j + 1]];
            var ok = isRotate(tmp);
            if(ok){
                isOK = true;
                break;
            }
        }

        //even
        for(var j = 1; j < n - 2; j++){
            if(list[j] == list[j + 1]){
                var tmp = [list[j - 1], list[j], list[j + 1], list[j + 2]];
                var ok = isRotate(tmp);
                if(ok){
                    isOK = true;
                    break;
                }
            }
        }

        if(isOK){
            output[i] = "YES";
        }else{
            output[i] = "NO";
        }
    }
    myout(myconv(output,9));
}

function isRotate(list){
    var len = list.length;
    var is = true;
    for(var i = 0; i < Math.ceil(len / 2); i++){
        if(list[i] != list[len - i - 1]){
            is = false;
        }
    }
    return is;
}

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 n = nextInt();
        var list = nextIntArray();
        var isOK = false;
        //odd
        for(var j = 1; j < n - 1; j++){
            var tmp = [list[j - 1], list[j], list[j + 1]];
            var ok = isRotate(tmp);
            if(ok){
                isOK = true;
                break;
            }
        }

        //even
        for(var j = 1; j < n - 2; j++){
            if(list[j] == list[j + 1]){
                var tmp = [list[j - 1], list[j], list[j + 1], list[j + 2]];
                var ok = isRotate(tmp);
                if(ok){
                    isOK = true;
                    break;
                }
            }
        }

        if(isOK){
            output[i] = "YES";
        }else{
            output[i] = "NO";
        }
    }
    myout(myconv(output,9));
}

function isRotate(list){
    var len = list.length;
    var is = true;
    for(var i = 0; i < len; i++){
        if(list[i] != list[len - i - 1]){
            is = false;
        }
    }
    return is;
}

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 n = nextInt();
        var list = nextIntArray();
        var isOK = false;
        var tmp1 = [];
        for(var j = 0; j < n; j++){
            tmp1.push(list[j]);
            if(j >= 3){
                tmp1.shift();
            }
          if(j >= 2){
            var ok = isRotate(tmp1);
            if(ok){
                isOK = true;
                break;
            }
           }
        }

        var tmp2 = [];
        for(var j = 0; j < n; j++){
            tmp2.push(list[j]);
            if(j >= 4){
                tmp2.shift();
            }
          if(j >= 3){
            var ok = isRotate(tmp2);
            if(ok){
                isOK = true;
                break;
            }
           }
        }
        if(isOK){
            output[i] = "YES";
        }else{
            output[i] = "NO";
        }
    }
    myout(myconv(output,9));
}

function isRotate(list){
    var len = list.length;
    var is = true;
    for(var i = 0; i < Math.ceil(len / 2); i++){
        if(list[i] != list[len - i - 1]){
            is = false;
        }
    }
    return is;
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var str = readline().split(' ').join('');
  var pp = [];
  for(var i = 0; i < 9; i++) {
    for(var j = 0; j < 9; j++) {
      pp.push([i, j, i].join(''))
      pp.push([i, j, j, i].join(''))
    }
  }
  for(var i = 0; i < pp.length; i++) {
    if (str.indexOf(pp[i]) !== -1) {
      print('YES')
      break
    } else if (i == pp.length - 1) {
      print('NO')
    }
  }
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var str = readline().split(' ').join('');
  var pp = [];
  if (n < 3) {
    print('NO')
    break;
  }
  for(var i = 0; i <= 9; i++) {
    for(var j = 0; j <= 9; j++) {
      pp.push([i, j, i].join(''))
      pp.push([i, j, j, i].join(''))
    }
  }
  for(var i = 0; i < pp.length; i++) {
    if (str.indexOf(pp[i]) !== -1) {
      print('YES')
      break
    } else if (i === pp.length - 1) {
      print('NO')
    }
  }
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var str = readline().split(' ').join('');
  var pp = [];
  if (n < 2) {
    print('NO')
    break;
  }
  for(var i = 0; i < 9; i++) {
    for(var j = 0; j < 9; j++) {
      pp.push([i, j, i].join(''))
      pp.push([i, j, j, i].join(''))
    }
  }
  for(var i = 0; i < pp.length; i++) {
    if (str.indexOf(pp[i]) !== -1) {
      print('YES')
      break
    } else if (i === pp.length - 1) {
      print('NO')
    }
  }
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var nums = readline().split(' ').map(Number);
  var result = ''
  for (var i = 0; i < nums.length - 2; i++) {
    if ((nums[i] === nums[i + 2]) || (i < nums.length - 2 && nums[i] === nums[i + 3] && nums[i + 1] === nums[i + 2] )) {
      result = 'YES'
      break
    }
  }
  print(result || 'NO')
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var str = readline().split(' ').join('');
  var pp = [];
  if (n < 3) {
    print('NO')
    break;
  }
  for(var i = 0; i < 9; i++) {
    for(var j = 0; j < 9; j++) {
      pp.push([i, j, i].join(''))
      pp.push([i, j, j, i].join(''))
    }
  }
  for(var i = 0; i < pp.length; i++) {
    if (str.indexOf(pp[i]) !== -1) {
      print('YES')
      break
    } else if (i === pp.length - 1) {
      print('NO')
    }
  }
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var str = readline().split(' ').join('');
  var pp = [];
  if (n < 3) {
    print('NO')
    break;
  }
  for(var i = 0; i <= 9; i++) {
    for(var j = 0; j <= 9; j++) {
      pp.push([i, j, i].join(''))
      pp.push([i, j, j, i].join(''))
    }
  }
  var result = ''
  for(var i = 0; i < pp.length; i++) {
    if (str.indexOf(pp[i]) !== -1) {
      result = 'YES'
      break
    }
  }
  print(result || 'NO')
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var nums = readline().split(' ').map(Number);
  var map = {}
  var result = ''
  for (var i = 0; i < nums.length; i++) {
    var num = nums[i];
    if (!map[num]) map[num] = {count: 0, last: i}
    map[num].count++
    if (map[num] > 2 || map[num].last + 1 < i) {
      result = 'YES'
      break
    }
    map[num].last = i
  }
  print(result || 'NO')
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var nums = readline().split(' ').map(Number);
  var result = ''
  for (var i = 0; i < nums.length - 1; i++) {
    if ((nums[i] === nums[i + 2]) || (i < nums.length - 2 && nums[i] === nums[i + 3] && nums[i + 1] === nums[i + 2] )) {
      result = 'YES'
      break
    }
  }
  print(result || 'NO')
}


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 n = lines[i];
        if(n % 2 === 0){
            console.log(2, n - 3, 1);
            continue;
        }
        var a = (n - 1) / 2;
        if(a % 2 === 0){
            console.log(a - 1, a + 1, 1);
        }else{
            console.log(a - 2, a + 2, 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();
  });
  solve();
  // cmd: node solution.js < input.txt > output.txt
});
function readLine() {
  return inputString[currentLine++];
}

function solve() {
  let t = parseInt(readLine());
  while (t--) {
	let n = parseInt(readLine());
    problem(n);
  }
}
function gcd(i,j){
    if(j===0){
        return i;
    }
    return gcd(j,i%j);
}
function problem(n){
    n--;
    if(n%2!==0){
        console.log(`${parseInt(n/2)} ${parseInt((n+1)/2)} ${1}`);
    }else {
        let temp=n/2;
        for(let i=1;i<temp;i++){
            if(gcd(temp-i,temp+i)===1){
                console.log(`${temp-i} ${temp+i} ${1}`);
                break;
            }
        }
    }
}

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)
        main()
        process.exit(0)
    }
})

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

    return gcd(b, a % b);
}

function solve(arr) {
    let b, s2 = Math.floor(arr / 2)
    for (let c = 1; c < arr; ++c) {
        for (let a = 0; a < s2; ++a) {
            b = arr - c - a;
            if (a === b || b === c || c === a) {
                continue
            }
            if (gcd(a, b) === c) {
                console.log(`${a} ${b} ${c}`)
                return
            }
        }
    }
}

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

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

    for (var t=0; t<tests;t++) {
        n = parseInt(readline());
        var ans;
        if (n & 1) {
            var mid = (n-1) / 2;
            if (mid & 1) {
                ans = [mid + 2, mid - 2, 1];
            } else {
                ans = [mid + 1, mid - 1, 1];
            }
        } else {
            ans = [n / 2, n / 2 - 1, 1];
        }
        print(ans.join(' '));
    }

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 n = lines[i];
        var a = new Map();
        for(j = 1; j * j <= n; j++){
            a.set(j * j, 1);
        }
        for(j = 1; j * j * j <= n; j++){
            a.set(j * j * j, 1);
        }
        console.log(a.size);
    }
});

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();
  });
  solve();
  // cmd: node solution.js < input.txt > output.txt
});
function readLine() {
  return inputString[currentLine++];
}

function solve() {
  let t = parseInt(readLine());
  while (t--) {
	let n = parseInt(readLine());
    GCDP(n);
  }
}
function GCDP(n){
    console.log(`${1} ${n-2} ${1}`);
}


process.stdin.resume();
process.stdin.setEncoding("utf8");
let standardInputString = "";
let curLine = 0;

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

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

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

  main();
});

// Codeforces Round #752 (Div. 2)

// B

const main = () => {
  const t = +readLine();

  for (let testCaseNum = 0; testCaseNum < t; testCaseNum += 1) {
    const sequenceLen = +readLine();

    const sequence = readLine()
      .split(' ')
      .map(str => +str);

    let xorIsZero = sequenceLen % 2 === 0;

    for (let ix = 1; ix < sequenceLen; ix += 1) {
      xorIsZero = xorIsZero || sequence[ix] <= sequence[ix - 1];
    }

    console.log(xorIsZero ? 'YES' : 'NO');
  }
};

//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 list = nextIntArray(N);
		var isOK = (N % 2 == 0);
		for(var i = 0; i < N - 1; i++){
			if(list[i] >= list[i + 1]){
				isOK = true;
				break;
			}
		}
		if(isOK){
			myout("Yes");
		}else{
			myout("No");
		}
	}
}

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 * 2
    } 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(i => +i))
        main()
        process.exit(0)
    }
})

function solve([n], arr) {
    let res = true
    if (n % 2) {
        res = false
        for (let j = 1; j < n; j++) {
            if (arr[j] <= arr[j - 1]) {
                res = true
                break;
            }
        }
    }
    if (res) {
        console.log("YES")
    } else {
        console.log("NO")
    }
}

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

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        const n = +lines[l++]
        const arr = lines[l++].trim().split(' ').map(Number)
        output[i] = solve(n, arr)
    }
    console.log(output.join('\n'))
// })()
})

function solve(n, arr) {
    if (!(n & 1)) return 'YES'

    for (let i = 1; i < arr.length; i++) {
        if (arr[i] <= arr[i - 1]) {
            return 'YES'
        }
    }
    return 'NO'
}

const solve = (n,arr)=>{
     if(n%2===0) console.log("YES");
     else{
          for(let i=0;i<n-1;i++){
               if(arr[i]>=arr[i+1]){
                    console.log("YES");
                    return;
               }
          }
          console.log("NO");
     }
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let n = parseInt(readline());
       let arr =  readline().trim().split(" ").map(cur=>parseInt(cur));
       solve(n,arr);
  }
}
main();

const solve = (n,arr)=>{
     if(n%2===0) console.log("YES");
     else{
          let obj = {};
          for(let i=0;i<n;i++){
               if(obj[arr[i]]){
                    console.log("YES");
                    return;
               }
               obj[arr[i]] = true;
          }
          console.log("NO");
     }
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let n = parseInt(readline());
       let arr =  readline().trim().split(" ").map(cur=>parseInt(cur));
       solve(n,arr);
  }
}
main();

const solve = (n,arr)=>{
     if(n%2===0) console.log("YES");
     else{
          let obj = {};
          for(let i=0;i<n;i++){
               if(obj[arr[i]]){
                    console.log("YES");
                    return;
               }
               obj[arr[i]] = 1;
          }
          console.log("NO");
     }
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let n = parseInt(readline());
       let arr =  readline().trim().split("").map(cur=>parseInt(cur));
       solve(n,arr);
  }
}
main();

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 * 2
    } 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(' '))
        main()
        process.exit(0)
    }
})

function solve([n], arr) {
    let res = true
    if (n % 2 !== 0) {
        res = false;
        for (let j = 1; j < n; ++j) {
            if (arr[j] <= arr[j - 1]) {
                res = true
                break
            }
        }
    }
    if (res) {
        console.log("YES")
    } else {
        console.log("NO")
    }
}

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

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        const n = +lines[l++]
        const arr = lines[l++].trim().split(' ').map(Number)
        output[i] = solve(n, arr)
    }
    console.log(output.join('\n'))
// })()
})

function solve(n, arr) {
    if (!(n & 1)) return 'YES'

    for (let i = 2; i < arr.length; i++) {
        if (arr[i] < arr[i - 1]) {
            return 'YES'
        }
    }
    return 'NO'
}

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        const n = +lines[l++]
        const arr = lines[l++].trim().split(' ').map(Number)
        output[i] = solve(n, arr)
    }
    console.log(output.join('\n'))
// })()
})

function solve(n, arr) {
    if (!(n & 1)) return 'YES'

    for (let i = 2; i < arr.length; i++) {
        if (arr[i] <= arr[i - 1]) {
            return 'YES'
        }
    }
    return 'NO'
}