'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 = parseInt(readline());
        let a = 0,b = 0,c = 0;
        for(let i = 2; i*i < n; i++) {
            if(n % i == 0) {
                a = i;
                n = n / a;
                break;
            }
        }
        if(a==0) {
            print("NO");
            continue;
        }
        for(let i = a + 1; i*i < n; i++) {
            if(n % i == 0) {
                b = i;
                n = n / b;
                break;
            }
        }
        if(b==0) {
            print("NO");
            continue;
        }
        c = n;
        if(c != 1 && c != a && c != b) {
            print("YES");
            write(a + " " + b + " " + c + "\n");
            continue;
        } else {
            print("NO");
            continue;
        }
    }

}

function solve (n){
	var found = 0;
	var stop = Math.floor(Math.sqrt(n));
	for(var i = 2; i <= stop; i++ )
	{
		if (n%i == 0)
		{
			if (found < 1){
				mySet.add(i);
				found+=1;
				n /= i;
			}
			else
			{
				mySet.add(i);
				if (n%i == 0){
				mySet.add(n/i);
				break
			}
			else{
				break;
			}
			}

		}
	}
	if (mySet.size == 3){
		print('YES');
		var interim = [...mySet]
		print(interim[0],interim[1],interim[2]);
	}
	else{
		print('NO');
	}
}
var mySet = new Set();
var queries = parseInt(readline())
for (var k =0 ;k <queries;k++){
solve(parseInt(readline()))
mySet.clear();
}

'use strict'

const problem = (n) => {
    for (let i = 2; i < Math.cbrt(n); i++) {
        if (n % i === 0) {
            n /= i;
            for (let j = i + 1; j < Math.sqrt(n); j++) {
                if (n % j === 0) return `YES\n${i} ${j} ${n/j}`;
            }
        }
    }
    return 'NO';
}

let t = +readline();
while(t--) print(problem(+readline()));

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
//[no]param
//不明値:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
function myconv(i,no){switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").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;}}
function Main() {
   var t = myconv(next(),1);
  var output = [];
  for(var i = 0; i < t; i++){
      var n = myconv(next(),1);
      var list = getDivisorList(n);
      var yesFlg = false;
      for(var j = 1; j < list.length -2; j++){
          if(yesFlg){break;}
          for(var k = j+1; k < list.length -1; k++){
              if(yesFlg){break;}
              for(var l = k+1; l < list.length; l++){
                  if(list[j] * list[k] * list[l] == n){
                      yesFlg = true;
                      output.push("YES");
                      output.push(list[j] + " " + list[k] + " " + list[l]);
                      break;
                  }
              }
          }
      }
      if(!yesFlg){
          output.push("NO");
      }

  }
  myout(myconv(output,9));
}
function getDivisorList(val){
        var list = [];
        for(var i = 1; i * i <= val; i++){
                if(val % i == 0){
                        list.push(i);
                        if(i * i != val){
                                list.push(val / i);
                        }
                }
        }
        list.sort(function(a,b){ return a - b; });
        return list;
}

function main() {
  var testCasesNum = +readline();
  for (var i = 0; i < testCasesNum; i++) {
    findNext();
  }
}

function findNext() {
    var num = +readline();
    var n1 = findDiv(num);
    var n2;
    if (n1) {
        n2 = findDiv(num / n1, n1);
    }
    var n3;
    if (n1 && n2) {
        n3 = (num / n1) / n2
    }
    if (n1 && n2 && (n3 >= 2) && (n3 % 1 === 0) && n3 !== n1 && n3 !== n2) {
        print('YES');
        print(n1 + ' ' + n2 + ' ' + n3);
    } else {
        print('NO');
    }
};

function findDiv(n, ex1) {
    var sqrtN = Math.ceil(Math.sqrt(n));
    for (var i = 2; i < sqrtN; i += 1) {
        if (n % i === 0 && i !== ex1) {
            return i;
        }
    }
    return 0;
};

main()

var t = parseInt(readline(), 10);

for(var i=1; i<=t; i++) {
    var n = parseInt(readline(), 10), a = 0, b = 0, c = 0, rem, valid = false;

    for(var j=2; j<=Math.sqrt(n); j++) {
        if(n%j === 0) {
            a = j;
            rem = n/j;

            for(var k=j+1; k<=Math.sqrt(n); k++) {
                if(rem%k === 0) {
                    b = k;
                    c = rem/k;

                    if(b !== c) valid = true;

                    break;
                }
            }

            break;
        }
    }

    if(a === b || a === c || b === c) valid = false;
    else valid = true;

    if(valid) {
        print('YES');
        print(a, b, c);

    } else print('NO');
}

var T = parseInt(readline(), 10);

for(var t=1; t<=T; t++) {
    var n = parseInt(readline(), 10);
    var ok = false;
    var x=0,y=0,z=0;
    for(var a=2; !ok && a<=Math.sqrt(n); a++) {
        if(n%a != 0) continue;
        for(var b=a+1; !ok && b<=Math.sqrt(n); b++) {
            x = a; y = b; z = n/(a*b);
            if(z <= 1 || z == x || z == y || n%(x*y) != 0) continue;
            ok = true;
        }
    }
    if(ok) {
        print('YES');
        print(x,y,z);
    }
    else print('NO');
}

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

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

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

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

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

function findPrimeFactors (num) {
  let primeFactors = [];
  while (num % 2 === 0) {
    primeFactors.push(2);
    num = num / 2;
  }

  let sqrtNum = Math.sqrt(num);
  for (let i = 3; i <= sqrtNum; i++) {
    while (num % i === 0) {
      primeFactors.push(i);
      num = num / i;
    }
  }

  if (num > 2) {
    primeFactors.push(num);
  }
  return primeFactors;
}

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

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

function main(input) {
  let i = 0
  const t = readInt(input, i++)

  for(let j = 0; j < t; j++) {
    const n = readInt(input, i++)

    let p = findPrimeFactors(n)
    let k = 0
    let a = 1, b = 1, c = 1
    let f = true
    if(p[k] === n) {
      wr('NO')
      continue
    }
    for(let len = p.length; k < len; k++) {
      if(k === 0) {
        a = p[k]
      }
      else if(b <= a) {
        b *= p[k]
      }
      else {
        c = n / (a * b)
        break
      }
    }
    if(a === 1 || b === 1 || c === 1 || (b === c) || (b <= a) || (a === c)) {
      wr('NO')
    }
    else {
      wr('YES')
      wr(`${a} ${b} ${c}`)
    }
  }
}

var t = parseInt(readline(), 10);

for(var i=1; i<=t; i++) {
    var n = parseInt(readline(), 10), a, b, c, rem, valid = false;

    for(var j=2; j<=Math.sqrt(n); j++) {
        if(n%j === 0) {
            a = j;
            rem = n/j;

            for(var k=j+1; k<=Math.sqrt(n); k++) {
                if(rem%k === 0) {
                    b = k;
                    c = rem/k;
                    valid = true;
                    break;
                }
            }

            break;
        }
    }

    if(valid) {
        print('YES');
        print(a, b, c);

    } else print('NO');
}

var T = parseInt(readline(), 10);

for(var t=1; t<=T; t++) {
    var n = parseInt(readline(), 10);
    var ok = false;
    var x=0,y=0,z=0;
    for(var a=2; !ok && a<=2000; a++) {
        for(var b=a+1; !ok && b<=2000; b++) {
            x = a; y = b; z = n/(a*b);
            if(z <= 1 || z == x || z == y || n%(x*y) != 0) continue;
        }
    }
    if(ok) {
        print('YES');
        print(x,y,z);
    }
    else print('NO');
}

var T = parseInt(readline(), 10);

for(var t=1; t<=T; t++) {
    var n = parseInt(readline(), 10);
    var ok = false;
    var x=0,y=0,z=0;
    for(var a=2; !ok && a<=2000; a++) {
        for(var b=a+1; !ok && b<=2000; b++) {
            x = a; y = b; z = n/(a*b);
            if(z <= 1 || z == x || z == y || n%(x*y) != 0) continue;
            ok = true;
        }
    }
    if(ok) {
        print('YES');
        print(x,y,z);
    }
    else print('NO');
}

var T = parseInt(readline(), 10);

for(var t=1; t<=T; t++) {
    var n = parseInt(readline(), 10);
    var ok = false;
    var x=0,y=0,z=0;
    for(var a=2; !ok && a<=1000 && a<=n; a++) {
        for(var b=a+1; !ok && b<=1000 && b<=n/a; b++) {
            x = a; y = b; z = n/(a*b);
            if(n%(a*b)==0 && n != a*b && n/(a*b) != a && n/(a*b) != b) {
                ok = true;
            }
        }
    }
    if(ok) {
        print('YES');
        print(x,y,z);
    }
    else print('NO');
}

var T = parseInt(readline(), 10);

for(var t=1; t<=T; t++) {
    var n = parseInt(readline(), 10);
    var ok = false;
    for(var a=2; !ok && a<=1000 && a<=n; a++) {
        for(var b=a; !ok && b<=1000 && b<=n/a; b++) {
            if(n%(a*b)==0) ok = true;
        }
    }
    if(ok) print('YES');
    else print('NO');
}

function solve (n){
	var found = 0;
	for(var i = 2; i <= 10; i++ )
	{
		if (found == 2){
			break;
		}
		if (n%i == 0)
		{
			if (found < 1){
				mySet.add(i);
				found+=1;
				n /= i;
			}
			else
			{
				mySet.add(i);
				mySet.add(n/i);
				found +=1;
			}
		}
	}
	if (mySet.size == 3){
		print('YES');
		print([...mySet]);
	}
	else{
		print('NO');
	}
}
var mySet = new Set();
var queries = parseInt(readline())
for (var k =0 ;k <queries;k++){
solve(parseInt(readline()))
mySet.clear();
}

function solve (n){
	var found = 0;
	for(var i = 2; i <= 10; i++ )
	{
		if (found == 2){
			break;
		}
		if (n%i == 0)
		{
			if (found < 1){
				mySet.add(i);
				found+=1;
				n /= i;
			}
			else
			{
				mySet.add(i);
				mySet.add(n/i);
				found +=1;
			}
		}
	}
	if (mySet.size == 3){
		print('YES');
		var interim = [...mySet]
		print(interim[0],interim[1],interim[2]);
	}
	else{
		print('NO');
	}
}
var mySet = new Set();
var queries = parseInt(readline())
for (var k =0 ;k <queries;k++){
solve(parseInt(readline()))
mySet.clear();
}

function solve (n){
	var found = 0;
	for(var i = 2; i <= 10; i++ )
	{
		if (found == 2){
			break;
		}
		if (n%i == 0)
		{
			if (found < 1){
				mySet.add(i);
				found+=1;
				n /= i;
			}
			else
			{
				mySet.add(i);
				if (n/i != 1){
				mySet.add(n/i);
			}
				found +=1;
			}
		}
	}
	if (mySet.size == 3){
		print('YES');
		var interim = [...mySet]
		print(interim[0],interim[1],interim[2]);
	}
	else{
		print('NO');
	}
}
var mySet = new Set();
var queries = parseInt(readline())
for (var k =0 ;k <queries;k++){
solve(parseInt(readline()))
mySet.clear();
}

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
//[no]param
//不明値:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
function myconv(i,no){switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").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;}}
function Main() {
  var t = myconv(next(),1);
  var output = [];
  for(var i = 0; i < t; i++){
      var n = myconv(next(),1);
      var out = [];
      var tmpN = n;
      for(var j = 2; j <= Math.sqrt(n); j++){
          if(tmpN % j == 0){
              out.push(j);
              tmpN /= j;
          }
          if(out.length == 2){
            if(out[1] != tmpN && n % tmpN == 0){
              out.push(tmpN);
            }
            break;
          }
      }
      if(out.length == 3){
          output.push("YES");
          output.push(myconv(out,8));
      }else{
          output.push("NO");
      }
  }
  myout(myconv(output,9));
}

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
//[no]param
//不明値:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
function myconv(i,no){switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").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;}}
function Main() {
  var t = myconv(next(),1);
  var output = [];
  for(var i = 0; i < t; i++){
      var n = myconv(next(),1);
      var out = [];
      var tmpN = n;
      for(var j = 2; j <= Math.sqrt(n); j++){
          if(n % j == 0){
              out.push(j);
              tmpN /= j;
          }
          if(out.length == 2){
            if(out[1] != tmpN){
              out.push(tmpN);
            }
            break;
          }
      }
      if(out.length == 3){
          output.push("YES");
          output.push(myconv(out,8));
      }else{
          output.push("NO");
      }
  }
  myout(myconv(output,9));
}

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
//[no]param
//不明値:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
function myconv(i,no){switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").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;}}
function Main() {
   var t = myconv(next(),1);
  var output = [];
  for(var i = 0; i < t; i++){
      var n = myconv(next(),1);
      var out = [];
      var tmpN = n;
    var first = false;
      for(var j = 2; j <= Math.sqrt(n); j++){
          if(tmpN % j == 0 && !first){
              out.push(j);
              tmpN /= j;
            first = true;
              continue;
          }
        if(tmpN % j == 0 && n % (tmpN / j) == 0 && j != tmpN / j){
            out.push(j);
            out.push(tmpN / j);
            break;
          }
      }
      if(out.length == 3){
          output.push("YES");
          output.push(myconv(out,8));
      }else{
          output.push("NO");
      }
  }
  myout(myconv(output,9));
}

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
//[no]param
//不明値:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
function myconv(i,no){switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").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;}}
function Main() {
  var t = myconv(next(),1);
  var output = [];
  for(var i = 0; i < t; i++){
      var n = myconv(next(),1);
      var out = [];
      var tmpN = n;
      for(var j = 2; j <= Math.sqrt(n); j++){
          if(n % j == 0){
              out.push(j);
              tmpN /= j;
          }
          if(out.length == 2){
            if(out[1] != tmpN && n % tmpN == 0){
              out.push(tmpN);
            }
            break;
          }
      }
      if(out.length == 3){
          output.push("YES");
          output.push(myconv(out,8));
      }else{
          output.push("NO");
      }
  }
  myout(myconv(output,9));
}

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
//[no]param
//不明値:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
function myconv(i,no){switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").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;}}
function Main() {
   var t = myconv(next(),1);
  var output = [];
  for(var i = 0; i < t; i++){
      var n = myconv(next(),1);
      var out = [];
      var tmpN = n;
    var first = false;
      for(var j = 2; j <= Math.sqrt(n); j++){
          if(tmpN % j == 0 && !first){
              out.push(j);
              tmpN /= j;
            first = true;
              continue;
          }
        if(tmpN % j == 0){
          if(n % (tmpN / j) == 0){
            out.push(j);
            out.push(tmpN / j);
            break;
           }
          }
      }
      if(out.length == 3){
          output.push("YES");
          output.push(myconv(out,8));
      }else{
          output.push("NO");
      }
  }
  myout(myconv(output,9));
}

function main() {
  var testCasesNum = +readline();
  for (var i = 0; i < testCasesNum; i++) {
    findNext();
  }
}

function findNext() {
    var num = +readline();
    var n1 = findDiv(num);
    var n2;
    if (n1) {
        n2 = findDiv(num / n1);
    }
    var n3;
    if (n1 && n2) {
        n3 = (num / n1) / n2;
    }
    if (n1 && n2 && (n3 >= 2) && (n3 % 1 === 0)) {
        print('YES');
        print(n1 + ' ' + n2 + ' ' + n3);
    } else {
        print('NO');
    }
};

function findDiv(n) {
    if (n % 2 === 0) {
        return 2;
    }
    var sqrtN = Math.ceil(Math.sqrt(n));
    for (var i = 3; i < sqrtN; i += 2) {
        if (n % i === 0) {
            return i;
        }
    }
    return 0;
};
main()

var t = parseInt(readline(), 10);

for(var i=1; i<=t; i++) {
    var n = parseInt(readline(), 10), a, b, c, rem, valid = false;

    for(var j=2; j<=Math.sqrt(n); j++) {
        if(n%j === 0) {
            a = j;
            rem = n/j;

            for(var k=j+1; k<=Math.sqrt(n); k++) {
                if(rem%k === 0) {
                    b = k;
                    c = rem/k;

                    if(b !== c) valid = true;

                    break;
                }
            }

            break;
        }
    }

    if(valid) {
        print('YES');
        print(a, b, c);

    } else print('NO');
}

var t = parseInt(readline(), 10);

for(var i=1; i<=t; i++) {
    var n = parseInt(readline(), 10), a = 0, b = 0, c = 0, rem, valid = false;

    for(var j=2; j<=Math.sqrt(n); j++) {
        if(n%j === 0) {
            a = j;
            rem = n/j;

            for(var k=j+1; k<=Math.sqrt(n); k++) {
                if(rem%k === 0) {
                    b = k;
                    c = rem/k;

                    if(b !== c) valid = true;

                    break;
                }
            }

            break;
        }
    }

    if(a === b || a === c || b === c) valid = false;
    else valid = true;

    if(valid) {
        print('YES');
        print(a, b, c, n);

    } else print('NO');
}

var t = parseInt(readline(), 10);

for(var i=1; i<=t; i++) {
    var n = parseInt(readline(), 10), a, b, c, rem, valid = false;

    for(var j=2; j<=Math.sqrt(n); j++) {
        if(n%j === 0) {
            a = j;
            rem = n/j;

            for(var k=j+1; k<=Math.sqrt(n); k++) {
                if(rem%k === 0) {
                    b = k;
                    c = rem/k;

                    if(b !== c) valid = true;

                    break;
                }
            }

            break;
        }
    }

    if(a === b || a === c || b === c) valid = false;
    else valid = true;

    if(valid) {
        print('YES');
        print(a, b, c);

    } else print('NO');
}


var input = readline();
var aWordsCount = parseInt(input.split(" ")[0]);
var bWordsCount = parseInt(input.split(" ")[1]);

var aWords = readWordList(aWordsCount);
var bWords = readWordList(bWordsCount);
var commonWords = new Set(intersect(aWords, bWords));

var result = "YES";
var advantage = commonWords.size % 2 === 0 ? 0 : 1;
if (aWordsCount - commonWords.size + advantage <= bWordsCount - commonWords.size) {
    result = "NO";
}

print(result);

function readWordList(listLength) {
    var words = [];

    for (var i = 0; i < listLength; i++) {
        words.push(readline());
    }

    return words;
}

function intersect(a, b) {
    return a.filter(x => b.includes(x));
}

   var s = readline().split(' ');
   var n = +s[0], m = +s[1];
   var set = [], nw = 0, mw = 0, sh = 0;
   for (var i=0;i<n;i++)
   {
       s = readline();
       var index = set.indexOf(s);
       if (index==-1)
       {
           index = set.length;
           set.push(s);
       }
       nw++;
   }
   for (i=0;i<m;i++)
   {
       s = readline();
       var index = set.indexOf(s);
       if (index==-1)
       {
           index = set.length;
           set.push(s);
       }
       else sh++;
       mw++;
   }
   var h = 0;
   while(nw>0 && h==0 || mw>0 && h==1)
   {
       if (h)
       {
           mw--;
           if (sh){ sh--; nw--; }
       }
       else
       {
           nw--;
           if (sh){ sh--; mw--; }
       }
       h = 1 - h;
   }
   print(h ? 'YES' : 'NO');

var input = readline();
var aWordsCount = parseInt(input.split(" ")[0]);
var bWordsCount = parseInt(input.split(" ")[1]);

var aWords = readWordList(aWordsCount);
var bWords = readWordList(bWordsCount);
var commonWords = new Set(intersect(aWords, bWords));
aWordsCount -= commonWords.size;
bWordsCount -= commonWords.size;

var result = "NO";
if (commonWords.size % 2 === 0) {
    if (aWordsCount > bWordsCount + 1) {
        result = "YES";
    }
} else if (aWordsCount > bWordsCount - 1) {
    result = "YES"
}

print(result);

function readWordList(listLength) {
    var words = [];

    for (var i = 0; i < listLength; i++) {
        words.push(readline());
    }

    return words;
}

function intersect(a, b) {
    return a.filter(x => b.includes(x));
}

var input = readline();
var aWordsCount = parseInt(input.split(" ")[0]);
var bWordsCount = parseInt(input.split(" ")[1]);

var aWords = readWordList(aWordsCount);
var bWords = readWordList(bWordsCount);
var commonWords = new Set(intersect(aWords, bWords));

aWords = aWords.sort((a, b) => {
    return sortByPresenceInSet(a, b, commonWords);
});
bWords = bWords.sort((a, b) => {
    return sortByPresenceInSet(a, b, commonWords);
});

var usedWords = new Set();
var roundsCount = Math.max(aWordsCount, bWordsCount) + 1;
var result = "YES";

for (var i = 0; i < roundsCount; i++) {
    var a = useWord(usedWords, aWords);
    if (!a) {
        result = "NO";
        break;
    }

    var b = useWord(usedWords, bWords);
    if (!b) {
        break;
    }
}

print(result);

function useWord(usedWords, availableWords) {
    if (!availableWords.length) {
        return false;
    }

    if (usedWords.has(availableWords[0])) {
        availableWords.splice(0, 1)
        return useWord(usedWords, availableWords);
    }

    usedWords.add(availableWords[0])

    return true;
}

function readWordList(listLength) {
    var words = [];

    for (var i = 0; i < listLength; i++) {
        words.push(readline());
    }

    return words;
}

function intersect(a, b) {
    return a.filter(x => b.includes(a));
}

function sortByPresenceInSet(a, b, set) {
    if (commonWords.has(a)) {
        return -1;
    };

    if (commonWords.has(b)) {
        return 1
    };

    return 0;
}

var input = readline();
var aWordsCount = parseInt(input.split(" ")[0]);
var bWordsCount = parseInt(input.split(" ")[1]);

var aWords = readWordList(aWordsCount);
var bWords = readWordList(bWordsCount);
var commonWords = new Set(intersect(aWords, bWords));

var result = "NO";
if (commonWords.size % 2 === 0 && aWordsCount >= bWordsCount) {
    result = "YES";
}

print(result);

function readWordList(listLength) {
    var words = [];

    for (var i = 0; i < listLength; i++) {
        words.push(readline());
    }

    return words;
}

function intersect(a, b) {
    return a.filter(x => b.includes(x));
}

var input = readline();
var aWordsCount = parseInt(input.split(" ")[0]);
var bWordsCount = parseInt(input.split(" ")[1]);

var aWords = [];
var bWords = [];

for (var i = 0; i < aWordsCount; i++) {
    aWords.push(readline());
}

for (var i = 0; i < bWordsCount; i++) {
    bWords.push(readline());
}

var usedWords = new Set();
var roundsCount = Math.max(aWordsCount, bWordsCount) + 1;
var result = "YES";

for (var i = 0; i < roundsCount; i++) {
    var a = useWord(usedWords, aWords);
    if (!a) {
        result = "NO";
        break;
    }

    var b = useWord(usedWords, bWords);
    if (!b) {
        break;
    }
}

print(result);

function useWord(usedWords, availableWords) {
    if (!availableWords.length) {
        return false;
    }

    if (usedWords.has(availableWords[0])) {
        availableWords.splice(0, 1)
        return useWord(usedWords, availableWords);
    }

    usedWords.add(availableWords[0])

    return true;
}


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

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

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

function main() {
	var words = [];
	for (var i = 0; i < 3; ++i) {
		words.push(trim(readline()).toLowerCase().replace(/[-;_]/g, ''));
	}
	var a = words[0], b = words[1], c = words[2],
		sentences = [a+b+c, a+c+b, b+a+c, b+c+a, c+a+b, c+b+a],
		n = parseInt(readline());
	for (var i = 0; i < n; ++i) {
		var input = trim(readline()).toLowerCase().replace(/[-;_]/g, '');
		for (var j = 0; j < 6; ++j) {
			if (input == sentences[j]) {
				print('ACC');
				break;
			}
		}
		if (j == 6) {
			print('WA');
		}
	}
}

main();

'use strict'

let A = readline().toLowerCase().replace(/[_;-]/g, '')
let B = readline().toLowerCase().replace(/[_;-]/g, '')
let C = readline().toLowerCase().replace(/[_;-]/g, '')
let N = readline()

let vars = [
  A + B + C,
  A + C + B,
  B + A + C,
  B + C + A,
  C + A + B,
  C + B + A
]

let R

while (R = readline()) {
  R = R.toLowerCase().replace(/[_;-]/g, '')
  let ok = false
  for (let i = 0; i < vars.length; i++) {
    if (vars[i] == R) {
      ok = true
      break
    }
  }
  print(ok ? 'ACC' : 'WA')
}

'use strict'

let A = readline().toLowerCase().replace(/[_;-]/g, '')
let B = readline().toLowerCase().replace(/[_;-]/g, '')
let C = readline().toLowerCase().replace(/[_;-]/g, '')
let N = readline()

let vars = [
  A + B + C,
  A + C + B,
  B + A + C,
  B + C + A,
  C + A + B,
  C + B + A
]

let R = readline()

while (R = R && R.toLowerCase().replace(/[_;-]/g, '')) {
  let ok = false
  for (let i = 0; i < vars.length; i++) {
    if (vars[i] == R) {
      ok = true
      break
    }
  }
  print(ok ? 'ACC' : 'WA')
  R = readline()
}


var t = parseInt(readline());

function mapper(s) { return +s; }

for(var qq = 0; qq < t; qq++) {
    var line = readline().split(' ').map(mapper);
    var n = line[0];
    var k = line[1];
    var a = readline().split(' ').map(mapper);
    var al = a.length;

    var max = 0;
    var left = -1;
    var curCount = 0;
    var pikes = [];

    for(var i = 0; i < al; i++) {
        pikes[i] = 0;
    }

    for(var i = al - 2; i >= 0; i--) {
        var idx = Math.min(i + k - 1, al - 1);

        if (pikes[idx]) {
            curCount -= 1;
        }

        if (a[i + 1] > a[i] && a[i + 1] > a[i + 2]) {
            pikes[i + 1] = ++curCount;

            if (curCount >= max) {
                max = curCount;
                left = i;
            }
        } else {
            pikes[i] = 0;
        }

        if (curCount === max) {
            left = i;
        }
    }
    print(max + 1, left + 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 main() {
    let range = readline();
    for(let r=0;r<range;r++) {
        let data = readline().split(" ").map(x => parseInt(x));
        let n = data[0];
        let k = data[1];
        let a = readline().split(" ").map(x => parseInt(x));
        let count = 0;
        let peak = new Array(a.length).fill(false);

        for(let i=1;i<n - 1;i++) {
            if(a[i] > a[i-1] && a[i] > a[i+1]) {

                peak[i] = true;
            }
        }

        let sum = 0;

        for(let i=1;i<k-1;i++) {
            if(peak[i]) {
                sum++;
            }
        }

        let max = sum;
        let counter = 1;
        let start = 1;
        for(let i=k-1;i<n;i++) {
            if(peak[i]) {
                sum++;
            }

            if(peak[counter]) {
                sum--;
            }

            if(sum > max) {
                max = sum;
                start = counter + 1;
            }

            counter++;
        }

        console.log((max+1) + " " + start);
    }

}


var all = [];
for(var i=0;i<100001;i++){
    all[i] = 0;
}

function calculate(num) {

    var half = Math.floor(Math.sqrt(num)) + 1;

    for (var i=1; i < half; i++) {
        if(num % i === 0 && i*i != num){
            all[i]++;
            all[num/i]++;
        } else if(num % i === 0){
            all[i]++;
        }
    }
}

function main() {
    var s1 = readline();
    var numbers = readline().split(' ').map(Number);
    numbers.map(calculate);
    all[1] = 1;
    all[0] = 0;
    print(Math.max(...all))
}

main()

function main()
{
    var n = Number(readline());
    var a = readline().split(' ').map( Number );

    var c = {};

    a.forEach( function( x ) {
        var t = ~~( Math.sqrt( x ) );
        for ( var i=2 ; i<=t ; i++ )
        {
            if ( x % i == 0 )
            {
                c[ i ] = c[i] ? c[i]+1 : 1;
                while ( x%i == 0 ) x /= i;
            }
        }
        if ( x )
        {
            c[ x ] = c[x] ? c[x]+1 : 1;
        }
    } );

    var ans = c[1] ? 1 : 0;
    delete c[1];
    for ( var i in c ) ans = Math.max( ans , c[i] );

    print( ans );

} main();

var all = [];
for(var i=0;i<100001;i++){
    all[i] = 0;
}

function calculate(num) {

    var half = Math.floor(Math.sqrt(num)) + 1;
    if(num == 1){
        return;
    }
    if(num==2){
        all[2]++
        return;
    }
    if(num==3){
        all[3]++;
        return;
    }

    for (var i=1; i < half; i++) {
        if(num % i === 0 && i*i != num){
            all[i]++;
            all[num/i]++;
        } else if(num % i === 0){
            all[i]++;
        }
    }
}

function main() {
    var s1 = readline();
    var numbers = readline().split(' ').map(Number);
    numbers.map(calculate);
    all[1] = 1;
    all[0] = 0;
    print(Math.max(...all))
}

main()

var all = [];
for(var i=0;i<100001;i++){
    all[i] = 0;
}

function calculate(num) {

    var half = Math.floor(Math.sqrt(num)) + 1;
    if(num == 1){
        return;
    }
    if(num==2){
        all[2]++
        return;
    }
    if(num==3){
        all[3]++;
    }

    for (var i=1; i < half; i++) {
        if(num % i === 0 && i*i != num){
            all[i]++;
            all[num/i]++;
        } else if(num % i === 0){
            all[i]++;
        }
    }
}

function main() {
    var s1 = readline();
    var numbers = readline().split(' ').map(Number);
    numbers.map(calculate);
    all[1] = 1;
    all[0] = 0;
    print(Math.max(...all))
}

main()

var all = [];
for(var i=0;i<100001;i++){
    all[i] = 0;
}

function calculate(num) {

    var half = Math.floor(Math.sqrt(num)) + 1;
    if(num == 1){
        return;
    }
    if(num==2){
        all[2]++
        return;
    }
    if(num==3){
        all[3]++;
    }

    for (var i=1; i < half; i++) {
        if(num % i === 0 && i*i != num){
            all[i]++;
            all[num/i]++;
        } else if(num % i === 0){
            all[i]++;
        }
    }
}

function main() {
    var s1 = readline();
    var numbers = readline().split(' ').map(Number);
    numbers.map(calculate);
    all[1] = 0;
    all[0] = 0;
    print(Math.max(...all))
}

main()

function main()
{
    var n = Number(readline());
    var a = readline().split(' ').map( Number );

    var c = {};

    a.forEach( function( x ) {
        var t = ~~( Math.sqrt( x ) );
        for ( var i=2 ; i<=t ; i++ )
        {
            if ( x % i == 0 )
            {
                c[ i ] = c[i] ? c[i]+1 : 1;
                while ( x%i == 0 ) x /= i;
            }
        }
        if ( x )
        {
            c[ x ] = c[x] ? c[x]+1 : 1;
        }
    } );

    var ans = 0;
    for ( var i in c ) ans = Math.max( ans , c[i] );

    print( ans );

} main();

function main()
{
    var n = Number(readline());
    var a = readline().split(' ').map( Number );

    var c = {};

    a.forEach( function( x ) {
        var t = ~~( Math.sqrt( x ) );
        for ( var i=2 ; i<=t ; i++ )
        {
            if ( x % i == 0 )
            {
                c[ i ] = c[i] ? c[i]+1 : 1;
                while ( x%i == 0 ) x /= i;
            }
        }
        if ( x )
        {
            c[ x ] = c[x] ? c[x]+1 : 1;
        }
    } );

    var ans = 0;
    delete c[1];
    for ( var i in c ) ans = Math.max( ans , c[i] );

    print( ans );

} main();


var r = readline();
var t= readline().split(' ').map(Number).reduce((a,c,i)=>{
    a[c].push(i+1)
    return a;
}, { 1:[], 2:[], 3:[] });

var min = Math.min(t[1].length, t[2].length, t[3].length);
	print(min);
	for (var i=0; i<min; i++){
		print(t[1][i],t[2][i],t[3][i]);
	}

var n = +readline(), t = readline().split(" "), p = [], m = [], s = [];
for(i = 0; i < n; i++){
	if(t[i] == "1"){
		p.push(i+1);
	}
	else if(t[i] == "2"){
		m.push(i+1);
	}
	else{
		s.push(i+1);
	}
}

write(Math.min(p.length,m.length,s.length));

if(Math.min(p.length,m.length,s.length) > 0){
	write("\n");
	for(i = 0; i < Math.min(p.length,m.length,s.length); i++){
		write( (i == Math.min(p.length,m.length,s.length)-1) ? (p[i] + " " + m[i] + " " + s[i]) : (p[i] + " " + m[i] + " " + s[i] + "\n") );
	}
}

var x= parseInt(readline());

var arr = readline().split(' ').map(each => parseInt(each));

var ones=[], twos=[], threes=[];
for(var i=0; i<arr.length; i++){
  if(arr[i]===1)
    ones.push(i+1);
  else if(arr[i]===2)
    twos.push(i+1);
  else
    threes.push(i+1);
}

var min = Math.min(ones.length, Math.min(twos.length, threes.length));

print(min);
i=0;

while(min--){
  print(ones[i]+" "+twos[i]+" "+threes[i]);
  i++;
}

var num = parseInt(readline()),
    students = readline().split(' ');

    students.forEach(function(value, i) {
        students[i] = parseInt(value);
    })

    var arrOfTeams = [],
    tempArr = [];

for (var i = 1; i <= num; i++){

    if(students[i - 1] === 1){

        for (var j = 1; j <= num; j++){

            if(students[j - 1] === 2){

                for (var k = 1; k <= num; k++){

                    if(students[k - 1] === 3){
                        arrOfTeams.push([i, j, k].join(' '))
                        students[i - 1] = 0;
                        students[j - 1] = 0;
                        students[k - 1] = 0;
                        break;
                    }

                }
                break;

            }

        }
        continue;
    }
}

print(arrOfTeams.length);

for(var i = 0; i < arrOfTeams.length; i++){
    print(arrOfTeams[i]);
}

var n = parseInt(readline());
var s, skillsInput = readline().split(' ');
var skills = [];
var programmers = [];
var mathematicians = [];
var athletes = [];
var groups = [];

for (var i = 0; i < skillsInput.length ; i++) {
    var skillCursor = parseInt(skillsInput[i]);
    switch (skillCursor) {
        case 1:
            programmers.push(i+1);
            break;
        case 2:
            mathematicians.push(i+1);
            break;
        case 3:
            athletes.push(i+1);
            break;
        default:
            athletes.push(i+1);
            break;
    }
}

for (var j = 0; j < programmers.length && j < mathematicians.length && j < athletes.length; j++) {
    groups.push({ programmer: programmers[j], mathematician: mathematicians[j], athlete: athletes[j] });
}

print(groups.length);

for (i = 0; i < groups.length; i++) {
    print(groups[i].programmer + " " + groups[i].mathematician + " " + groups[i].athlete);
}

  var numberOfStudents = readline();
  var students = readline()
    .split(' ')
    .map(Number);

  var studentsGroupedByStrength = {};
  for (var i = 1; i <= Number(numberOfStudents); i++) {
    var studentStrength = students[i - 1];
    if (!studentsGroupedByStrength.hasOwnProperty(studentStrength)) {
      studentsGroupedByStrength[studentStrength] = [i]
    } else {
      var prevValue = studentsGroupedByStrength[studentStrength];
      prevValue.push(i)
      studentsGroupedByStrength[studentStrength] = prevValue
    }
  }

  var numberOfTeam = Infinity
  var hasMinimumATeam = true
  for (var i = 1; i <= 3; i++) {
    if (studentsGroupedByStrength[i]) {
      numberOfTeam = Math.min(numberOfTeam, studentsGroupedByStrength[i].length)
    } else {
      hasMinimumATeam = false
    }
  }

  if (!hasMinimumATeam) {
    print(0)
  } else {
    print(numberOfTeam)
    for (var i = 0; i < numberOfTeam; i++) {
      var indexA = studentsGroupedByStrength['1'].pop()
      var indexB = studentsGroupedByStrength['2'].pop()
      var indexC = studentsGroupedByStrength['3'].pop()
      print(indexA + ' ' + indexB + ' ' + indexC)
    }
  }

var numberOfStudents = readline();
  var students = readline()
    .split(' ')
    .map(Number);

  var first = [];
  var second = [];
  var third = [];

  for (var i = 0; i < numberOfStudents; i++) {
    switch (students[i]) {
      case 1:
        first.push(i + 1);
        break;
      case 2:
        second.push(i + 1);
        break;
      case 3:
        third.push(i + 1);
        break;
    }
  }

  var team = Math.min(first.length, second.length, third.length)

  print(team)
  for (var i = 0; i < team; i++) {
    print(first.pop() + ' ' + second.pop() + ' ' + third.pop())
  }

var Team=function(){
	  this.team = [];

}
Team.prototype.print=function(){
	print(this.team.join(' '));
}
Team.prototype.setMember=function(i,v){
	this.team[i]=v;
}
var n = parseInt(readline().trim());

var t = readline().trim().split(' ').map((x)=>parseInt(x));
var t1=[],t2=[],t3=[];
for (var i = 0; i < n; i++) {
	switch(t[i]){
		case 1:
			t1.push(i+1);
		break;
		case 2:
			t2.push(i+1);
		break;
		case 3:
			t3.push(i+1);
		break;
	}
}
var ans = 0;
var teams = [];
while(t1.length>0 && t2.length>0 && t3.length){
	var _t = new Team();
	_t.setMember(0,t1.pop());
	_t.setMember(1,t2.pop());
	_t.setMember(2,t3.pop());
	teams.push(_t);
	ans++;
}
print(ans);
for (var i in teams) {
	teams[i].print();
}

///////////////////////////////////////////////////////////////////////////////
function readNumber () { return Number(readline()); }
function readNumbersArray () { return readline().split(' ').map(Number); }
function algebraicSum (startValue, finishValue, size) { return (startValue + finishValue) * size / 2; }
///////////////////////////////////////////////////////////////////////////////

var n = readNumber();
var t = readNumbersArray();

var prog = 0;
var mat = 0;
var fiz = 0;

t.forEach(function (v) {
	if (v === 1) prog++;
	if (v === 2) mat++;
	if (v === 3) fiz++;
});

var min = Math.min.apply(null, [prog, mat, fiz]);
print(min);

if (min > 0) {
	var prog_index = t.indexOf(1) + 1;
	var mat_index = t.indexOf(2) + 1;
	var fiz_index = t.indexOf(3) + 1;

	for (var i = 0; i < min; i++) {
		print([prog_index, mat_index, fiz_index].join(' '));
		prog_index = t.indexOf(1, prog_index) + 1;
		mat_index = t.indexOf(2, mat_index) + 1;
		fiz_index = t.indexOf(3, fiz_index) + 1;
	}
}

'use strict'
String.prototype.getNumArray = function () {
  return String(this).split(' ').map(function (value) {
    return parseInt(value);
  });
}
readline();
let students = readline().getNumArray();
let dictionary = {
  1: [],
  2: [],
  3: [],
};

for (let i = 0; i < students.length; i++) {
  dictionary[students[i]].push(i+1);
}

let min = dictionary[1].length;

if (dictionary[2].length < min) {
  min = dictionary[2].length;
}

if (dictionary[3].length < min) {
  min = dictionary[3].length;
}
write(min + '\n');

for (let i = 0; i < min; i++) {
  write(dictionary[1][i] + ' ' + dictionary[2][i] + ' ' + dictionary[3][i] + '\n');
}

//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 N = nextInt();
  var list = nextIntArray();
  var one = new Set();
  var two = new Set();
  var three = new Set();
  for(var i = 0; i < N; i++){
    switch(list[i]){
      case 1:
        one.add(i + 1);
        break;
      case 2:
        two.add(i + 1);
        break;
      case 3:
        three.add(i + 1);
        break;
                  }
  }
  var sizeMin = Math.min.apply(null, [one.size, two.size, three.size]);
  myout(sizeMin);
  var oneList = Array.from(one);
  var twoList = Array.from(two);
  var threeList = Array.from(three);
  for(var i = 0; i < sizeMin; i++){
    myout(oneList[i] + " " + twoList[i] + " " + threeList[i]);
  }
}

const readline = require('readline');

let secondLine = false;

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

let inputs = [];

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

// Read Inputs
rl.on('close', () => {
    const children = inputs[0]
    const skills = inputs[1].split(' ');
    let teams = [];
    let prgrammingSkills = [];
    let mathSkills = [];
    let physicsSkills = [];

    if (Math.floor(children / 3) < 1) return console.log(0);

    skills.forEach((skill, i) => {
        if (skill == 1) prgrammingSkills.push({ index: ++i });
        if (skill == 2) mathSkills.push({ index: ++i })
        if (skill == 3) physicsSkills.push({ index: ++i });
    })

    if (prgrammingSkills.length === 0 || mathSkills.length === 0 || physicsSkills.length === 0)
        return console.log(0);

    let estimatedTeams = Math.min(prgrammingSkills.length, mathSkills.length, physicsSkills.length);

    console.log(estimatedTeams)
    for (let i = 0; i < estimatedTeams; i++) {
        console.log(prgrammingSkills[i].index, mathSkills[i].index, physicsSkills[i].index);
    }

});

'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 print(s) {
  process.stdout.write(`${s}`);
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  // input
  const n = +readline();
  let a = readline().split(' ').map(x => parseInt(x));
  let t1 = 0, t2 = 0, t3 = 0;
  const r = [];
  while (t1 < n && t2 < n && t3 < n) {
    if (a[t1] !== 1) {
      t1++;
      continue;
    }
    if (a[t2] !== 2) {
      t2++;
      continue;
    }
    if (a[t3] !== 3) {
      t3++;
      continue;
    }
    r.push(`${t1 + 1} ${t2 + 1} ${t3 + 1}\n`);
    t1++;
    t2++;
    t3++;
  }
  print(`${r.length}\n`);
  r.forEach(x => print(x));
}

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

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

  const people = d.split(' ').map(Number);
  const programming = [];
  const math = [];
  const pe = [];

  people.forEach((x, idx) => {
    if (x === 1) {
      programming.push(idx + 1);
    }
    else if (x === 2) {
      math.push(idx + 1);
    }
    else {
      pe.push(idx + 1);
    }
  });

  const ans = Math.min(programming.length, math.length, pe.length);
  console.log(ans);

  for (let i = 0; i < ans; i++) {
    console.log(`${programming[i]} ${math[i]} ${pe[i]}`);
  }

  c++;
});

rl.on('close', () => {

});

'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 min(a,b) {
    if(a > b) return b;
    else return a;
}
function main() {
    let [n] = readint();
    let arr = readint();
    let t = [...arr];
    t.sort((a,b)=> (a - b));
    let ans = 6000;
    let cur = t[0];
    let count = 0;
    let proper = 0;
    t.forEach(element => {
        if(element == cur) count++;
        else {
            cur = element;
            ans = min(ans, count);
            count = 1;
            proper++;
        }
    });
    ans = min(ans, count);
    if(proper < 2) print(0);
    else {
        print(ans);
        for(let i = 0; i < ans; i++) {
            let j = 3;
            cur = 1;
            while(j--) {
                for(let k = 0; k < arr.length; k++) {
                    if(arr[k] == cur) {
                        write((k + 1) + " ");
                        arr[k] = 0;
                        break;
                    }
                }
                cur++;
            }
            console.log();
        }
    }
}

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

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  let [n] = input[0].split(' ').map(x => parseInt(x));
  const nums = input[1].split(' ').map(x => parseInt(x));

  const map = {};
  nums.forEach((x, i) => {
    if (map[x] === undefined) map[x] = [i+1]
    else map[x].push(i+1);
  });

  if (map[1] === undefined || map[2] === undefined || map[3] === undefined) {
    console.log(0); return;
  }

  let answ = Math.min(map[1].length, map[2].length, map[3].length);
  console.log(answ);answ

  for (let i = 0; i < answ; i += 1) {
    console.log(`${map[1].pop()} ${map[2].pop()} ${map[3].pop()}`)
  }
});

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

const readLine=()=> inputString[currentLine++];
/* ================================================
           Main Solution Starts Here
===================================================*/

const main=()=>{
	let n=+readLine()
	let one = 0,two=0,three=0
	let o=[],t=[],th=[]
	let ls = readLine().split(" ").map((n,index)=>{
		if(n==='1')
			one++ , o.push(index+1)
		else if (n==='2')
			two++ , t.push(index+1)
		else if(n==='3') three++, th.push(index+1)
	return +n
	})
	let teams = Math.min(one,Math.min(two,three))
	if(teams){
		console.log(teams)
		for(let i=0;i<teams;i++){
			console.log(o[i],t[i],th[i])
		}
	}else{
		console.log(teams)
	}
}

// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

/**
 *
 * @param {*} str
 * @param {*} seperator
 */
function splitter(str, seperator = '') {
    return str.trim().split(seperator);
}

/**
 *
 * @param {*} arr
 */
function strToNumArr(arr = []) {
    return arr.map(num => Number(num));
}

/**
 *
 * @param {*} num1
 * @param {*} num2
 */
function matrixArray(num1, num2) {
    return Array(num1).fill(Array(num2));
}

let log = function () {
    return Function.prototype.bind.call(console.log, console, '');
}();

function removeEmptyItem(arr, index) {
    return arr.slice(0, index).concat(arr.slice(index + 1, arr.length));
}

function range(min, max) {

    let arr = [];
    for (let index = min; index < max; index++) {
        arr.push(index);

    }
    return arr;
}

function main(input) {
    let output = nameLookUp(input);
    // process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(str) {

    let inputs = str.split('\n');
    let nSpecialites = strToNumArr(splitter(inputs[1], ' '));
    let n = inputs[0];

    let teamIndex = [];
    teamIndex[0] = [], teamIndex[1] = [], teamIndex[2] = [];

    let maxTeam = Math.floor(n / 2);

    for (let index = 0; index < nSpecialites.length; index++) {
        const element = nSpecialites[index];
        if (element == 1) {
            teamIndex[0].push(index + 1);
        }
        if (element == 2) {
            teamIndex[1].push(index + 1);
        }
        if (element == 3) {
            teamIndex[2].push(index + 1);
        }
    }
    let team = Math.min(teamIndex[0].length, teamIndex[1].length, teamIndex[2].length);
    console.log(team);
    for (let index = 0; index < team; index++) {
        const element = nSpecialites[index];
        console.log(teamIndex[0][index] + ' ' + teamIndex[1][index] + ' ' + teamIndex[2][index]);
    }
}

const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
let input = [];
readline.on('line', line => {
  input.push(line);
});
process.stdin.on('end', () => {
const students = parseFloat(input[0]);
const skillMap = { 1:[], 2:[], 3:[] };
let skills = input[1].split(' ');
let text = '';
let count = 0;
for (let i=0; i < skills.length; i++) {
  const skill = parseInt(skills[i], 10);
  skillMap[skill].push(i+1);
  if (Object.entries(skillMap).every((a) => a[1].length > 0)) {
    count += 1;
    for (const key in skillMap) {
      text += `${skillMap[key].pop()} `;
    }
      text = text.slice(0, -1);
      text += '\n';
  }
}
console.log(count);
console.log(text);

});

"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
        .replace(/\s*$/, "")
        .split("\n")
        .map((str) => str.replace(/\s*$/, ""));

    main();
});

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

function main() {
    let n = parseInt(readLine())
    let arr = readLine().split(' ').map(v => parseInt(v))
    let bla = []
    let ans = []
    if (arr.indexOf(1) == -1 || arr.indexOf(2) == -1 || arr.indexOf(3) == -1) {
        console.log(0)
    } else {
        for (var j = 1; j <= 3; j++) {
            let i = 0;
            while (arr.indexOf(j, i) != -1) {
                bla.push(arr.indexOf(j, i) + 1)
                i += 1
            }
            ans.push([...new Set(bla)]);
            bla = []
        }
        let a = ans.map((value) => value.length)
        console.log(Math.min(...a))
        for (let i = 0; i < Math.min(...a); i++) {
            console.log(ans[0][i], ans[1][i], ans[2][i])
        }
    }
}

"use strict";

var main = function() {
    var n = +rd();
    var T = [null].concat(rdAr());

    var S = new Array(4).fill(null).map(() => []);
    for (var i = 1; i < T.length; ++i) {
        S[T[i]].push(i);
    }
    S.shift();

    var r = Math.min(...S.map(v => v.length));
    pr(r);

    for (var i = 0; i < r; ++i) {
        prAr(S.map(v => v[i]));
    }
};

var rd = readline;
var wr = write;
var pr = print;
var rdAr = () => rd().split(' ').map(v => +v);
var prAr = (a) => pr(a.join(' '));
var cmpLt = (a, b) => a - b;
var cmpGt = (a, b) => b - a;

main();

n=Number(readline())

T=readline().split(' ').map(Number).reduce((a,c,i)=>{
    a[c].push(i+1)
    return a;
}, { 1:[], 2:[], 3:[] })
A=Math.min(T[1].length,T[2].length,T[3].length)
print(A)
for (i=0;i<A;++i)
    print(T[1][i],T[2][i],T[3][i])

if (!readline) {
    var _i = 0;
    var readline = function() {
        _i ++;

        switch (_i) {
            case 1: return '7';
            case 2: return '1 3 1 3 2 1 2';
        }
    }

    var write = console.log;
}

var n = +readline();
var t = [];

t[1] = [];
t[2] = [];
t[3] = [];

readline().split(' ').forEach(function(currentValue, index) {
    t[+currentValue].push(index + 1);
});

var k = Math.min(t[1].length, t[2].length, t[3].length);

write(k + '\n');

for (var i = 0; i < k; i ++) {
    write([t[1][i], t[2][i], t[3][i]].join(' ') + '\n');
}

var n = parseInt(readline()),
			childPerTimeMap = {},
			timeMap = {
				'1' : { 'count' : 0, 'mem' : [] },
				'2' : { 'count' : 0, 'mem' : [] },
				'3' : { 'count' : 0, 'mem' : [] }
			},
			times = readline().split(/\s/gi).map(function(t, childNo)	{
				childPerTimeMap[childNo + 1] = t;
				timeMap[t].count++;
				timeMap[t].mem.push(childNo + 1);

				return parseInt(t);
			});

		var minTime = Math.min(timeMap[1].count, timeMap[2].count, timeMap[3].count);

		if(!minTime)	print(0);
		else	{
			print(minTime);

			for(var index = 0; index < minTime; index++)	{
				var members = [];

				members.push(timeMap[1].mem[index]);
				members.push(timeMap[2].mem[index]);
				members.push(timeMap[3].mem[index]);

				print(members.join(' '));
			}
		}

var n = parseInt(readline()),
			timeMap = {
				'1' : { 'count' : 0, 'mem' : [] },
				'2' : { 'count' : 0, 'mem' : [] },
				'3' : { 'count' : 0, 'mem' : [] }
			},
			times = readline().split(/\s/gi).forEach(function(t, childNo)	{
				timeMap[t].count++;
				timeMap[t].mem.push(childNo + 1);
			});

		var minTime = Math.min(timeMap[1].count, timeMap[2].count, timeMap[3].count);

		if(!minTime)	print(0);
		else	{
			print(minTime);

			for(var index = 0; index < minTime; index++)	{
				var members = timeMap[1].mem[index] + ' ' +
				timeMap[2].mem[index] + ' ' +
				timeMap[3].mem[index];

				print(members);
			}
		}

var n = parseInt(readline()),
			timeMap = {
				'1' : { 'count' : 0, 'mem' : [] },
				'2' : { 'count' : 0, 'mem' : [] },
				'3' : { 'count' : 0, 'mem' : [] }
			},
			times = readline().split(/\s/gi).map(function(t, childNo)	{
				timeMap[t].count++;
				timeMap[t].mem.push(childNo + 1);

				return parseInt(t);
			});

		var minTime = Math.min(timeMap[1].count, timeMap[2].count, timeMap[3].count);

		if(!minTime)	print(0);
		else	{
			print(minTime);

			for(var index = 0; index < minTime; index++)	{
				var members = [];

				members.push(timeMap[1].mem[index]);
				members.push(timeMap[2].mem[index]);
				members.push(timeMap[3].mem[index]);

				print(members.join(' '));
			}
		}

var students = parseInt(readline());

var vals = readline().split(" ").map(Number);

var obj = {
    "1": [],
    "2": [],
    "3": []
}

for (var i = 0; i < vals.length; i++ ) {
    obj[+vals[i]].push(i + 1);
}

var total = Math.min(obj["1"].length, obj["2"].length, obj["3"].length);
print(total);

for (var i = 0; i < total; i++) {
    var team = [];
    team.push(obj["1"][i], obj["2"][i], obj["3"][i]);
    print(team.join(" "));
}

const readline = require('readline');

let secondLine = false;

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

let inputs = [];

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

// Read Inputs
rl.on('close', () => {
    const children = inputs[0]
    const skills = inputs[1].split(' ');
    let teams = [];
    let prgrammingSkills = [];
    let mathSkills = [];
    let physicsSkills = [];

    if (Math.floor(children / 3) < 1) return console.log(0);

    skills.forEach((skill, i) => {
        if (skill == 1) prgrammingSkills.push({ index: ++i });
        if (skill == 2) mathSkills.push({ index: ++i })
        if (skill == 3) physicsSkills.push({ index: ++i });
    })

    if (prgrammingSkills.length === 0 || mathSkills.length === 0 || physicsSkills.length === 0)
        return console.log(0);

    let estimatedTeams = Math.min(prgrammingSkills.length, mathSkills.length, physicsSkills.length);

    for (let i = 0; i < estimatedTeams; i++) {
        console.log(prgrammingSkills[i].index, mathSkills[i].index, physicsSkills[i].index);
    }

});

'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 min(a,b) {
    if(a > b) return b;
    else return a;
}
function main() {
    let [n] = readint();
    let arr = readint();
    let t = [...arr];
    t.sort((a,b)=> (a - b));
    let ans = 6000;
    let cur = t[0];
    let count = 0;
    t.forEach(element => {
        if(element == cur) count++;
        else {
            cur = element;
            ans = min(ans, count);
            count = 1;
        }
    });
    if(ans == 6000) print(0);
    else {
        print(ans);
        for(let i = 0; i < ans; i++) {
            let j = 3;
            cur = 1;
            while(--j) {
                arr.some((v, i) => {
                    if(v == cur) {
                        write((i + 1) + " ");
                        arr[i] = 0;
                        if(cur == 3)
                            return true;
                        else
                            cur++;
                    }
                });
            }
            console.log();
        }
    }
}

'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 min(a,b) {
    if(a > b) return b;
    else return a;
}
function main() {
    let [n] = readint();
    let arr = readint();
    let t = [...arr];
    t.sort((a,b)=> (a - b));
    let ans = 6000;
    let cur = t[0];
    let count = 0;
    let proper = 0;
    t.forEach(element => {
        if(element == cur) count++;
        else {
            cur = element;
            ans = min(ans, count);
            count = 1;
            proper++;
        }
    });
    if(proper < 2) print(0);
    else {
        print(ans);
        for(let i = 0; i < ans; i++) {
            let j = 3;
            cur = 1;
            while(--j) {
                arr.some((v, i) => {
                    if(v == cur) {
                        write((i + 1) + " ");
                        arr[i] = 0;
                        if(cur == 3)
                            return true;
                        else
                            cur++;
                    }
                });
            }
            console.log();
        }
    }
}

'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 min(a,b) {
    if(a > b) return b;
    else return a;
}
function main() {
    let [n] = readint();
    let arr = readint();
    let t = [...arr];
    t.sort((a,b)=> (a - b));
    let ans = 6000;
    let cur = t[0];
    let count = 0;
    t.forEach(element => {
        if(element == cur) count++;
        else {
            cur = element;
            ans = min(ans, count);
            count = 1;
        }
    });
    if(t[t.length - 1] < 3) print(0);
    else {
        print(ans);
        for(let i = 0; i < ans; i++) {
            let j = 3;
            cur = 1;
            while(--j) {
                arr.some((v, i) => {
                    if(v == cur) {
                        write((i + 1) + " ");
                        arr[i] = 0;
                        if(cur == 3)
                            return true;
                        else
                            cur++;
                    }
                });
            }
            console.log();
        }
    }
}

'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 min(a,b) {
    if(a > b) return b;
    else return a;
}
function main() {
    let [n] = readint();
    let arr = readint();
    let t = [...arr];
    t.sort((a,b)=> (a - b));
    let ans = 6000;
    let cur = t[0];
    let count = 0;
    let proper = 0;
    t.forEach(element => {
        if(element == cur) count++;
        else {
            cur = element;
            ans = min(ans, count);
            count = 1;
            proper++;
        }
    });
    if(proper < 2) print(0);
    else {
        print(ans);
        for(let i = 0; i < ans; i++) {
            let j = 3;
            cur = 1;
            while(j--) {
                for(let k = 0; k < arr.length; k++) {
                    if(arr[k] == cur) {
                        write((k + 1) + " ");
                        arr[k] = 0;
                        break;
                    }
                }
                cur++;
            }
            console.log();
        }
    }
}

var students = parseInt(readline());

var vals = readline().split(" ").map(Number);

var obj = {
    "1": [],
    "2": [],
    "3": []
}

for (var i = 0; i < vals.length; i++ ) {
    obj[+vals[i]].push(i + 1);
}

var total = Math.max(obj["1"].length, obj["2"].length, obj["3"].length);
print(total);

for (var i = 0; i < total; i++) {
    var team = [];
    team.push(obj["1"][i], obj["2"][i], obj["3"][i]);
    print(team.join(" "));
}

var students = parseInt(readline());

var vals = readline().split(" ").map(Number);

var obj = {
    "1": [],
    "2": [],
    "3": []
}

for (var i = 0; i < vals.length; i++ ) {
    obj[+vals[i]].push(i + 1);
}

var total = Math.max(obj["1"], obj["2"], obj["3"]);
print(total);

for (var i = 0; i < total; i++) {
    var team = [];
    team.push(obj["1"][i], obj["2"][i], obj["3"][i]);
    print(temp.join(" "));
}


var tc = parseInt(readline());
while(tc--){
    var A1 = readline().split(' ').map(x => parseInt(x));

    var total = A1.reduce((t, a)=> t+a, 0);
    print(total-1);
}

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

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

function main() {
  let t = +readLine();
  while (t--) {
    const [a, b, c] = readLine()
      .split(" ")
      .map((n) => BigInt(n));

    let ans = '';
    let sum = a + b + c;

    sum = sum - 1n;
    ans += sum;

    console.log(ans)

  }
}

function For(a, b, fn) {
  if (!fn) return For(0, a - 1, b);
  let res;
  for (let i = a; i <= b; i++) {
    if ((res = fn(i)) != null) return res;
  }
}
function ForR(a, b, fn) {
  if (!fn) return ForR(a - 1, 0, b);
  let res;
  for (let i = a; i >= b; i--) {
    if ((res = fn(i)) != null) return res;
  }
}

function Arr(a, b, fn) {
  if (typeof (b) == 'function') return Arr(0, a - 1, b);
  if (b < a) return [];
  let arr = Array(b - a + 1)
  for (let i = a; i <= b; i++) arr[i] = fn(i, arr);
  return arr;
}

Object.defineProperty(Object.prototype, '$k', {
  value: function () { return Object.keys(this) }
});
Object.defineProperty(Object.prototype, '$v', {
  value: function () { return Object.values(this) }
});
Object.defineProperty(Object.prototype, '$kv', {
  value: function () { return Object.entries(this) }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0) }
Array.prototype.uniq = function (fn) {
  var set = new Set();
  return this.filter(v => {
    var newValue = !set.has(fn ? fn(v) : v);
    set.add(fn ? fn(v) : v);
    return newValue;
  });
}
Array.prototype.toObj = function (fn) {
  return this.map(v => fn ? fn(v) : v).reduce((p, v) => {
    p[v[0]] = v[1];
    return p;
  }, {})
}
Array.prototype.min = function (fn) {
  let min = 1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x < min) { min = x; index = i }
  }
  return [this[index], index, min];
}
Array.prototype.max = function (fn) {
  let max = -1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x > max) { max = x; index = i }
  }
  return [this[index], index, max];
}
Array.prototype.rev = function (first, last) {
  for (let i = first; i < (first + last) / 2; i++) {
    [this[i], this[last - 1 - i + first]] = [this[last - 1 - i + first], this[i]]
  }
}
Array.prototype.set = function (pos, arr) {
  for (let i = pos; i < pos + arr.length; i++) {
    this[i] = arr[i - pos];
  }
}
Array.prototype.for = function (a, b, fn) {
  let res
  for (let i = a; i <= b; i++) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}
Array.prototype.forR = function (a, b, fn) {
  let res
  for (let i = a; i >= b; i--) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}
Array.prototype.bin = function (comp, a, b) {
  let mid;
  while (a < b) {
    mid = (a + b) / 2 | 0;
    if (typeof comp == 'function' ? comp(this[mid]) : this[mid] < comp) a = mid + 1;
    else b = mid;
  }
  return a;
}
Array.prototype.cut = function (fn, a, b) {
  let arr = [];
  let sub = [];
  a = a || 0;
  b = b || (this.length - 1);
  for (let i = a; i <= b; i++) {
    sub.push(this[i])
    if (fn(this[i], i, this)) {
      arr.push(sub);
      sub = [];
    }
  }
  return arr;
}

function gcd(a, b) {
  while (b) [a, b] = [b, a % b];
  return a;
}
function mul(a, b, m) {
  return ((a >> 16) * b % m * 65536 + (a & 65535) * b) % m
}
function pow(a, n, m) {
  let r = 1;
  while (n) n & 1 ? (r = mul(r, a, m), n--) : [a, n] = [mul(a, a, m), n >> 1]
  return r;
}
let MOD = 998244353
function inv(b) {
  for (var a = MOD, u = 0, v = 1, t; b; v = t)
    (t = a / b | 0, a -= t * b, u -= t * v, t = a, a = b, b = t, t = u, u = v);
  return (u + MOD) % MOD;
}

// let gt = Arr(n, (i, a) => i == 0 ? 1 : mul(a[i - 1], i, MOD));
// let rgt = Arr(n, (i, a) => i <= 1 ? 1 : MOD - mul((MOD / i | 0), a[998244353 % i], MOD));
// For(2, n - 1, i => { rgt[i] = mul(rgt[i], rgt[i - 1], MOD) });
// let nCk = (n, k) => mul(mul(gt[n], rgt[k], MOD), rgt[n - k], MOD);

// for (i = pos; i <= n; i += i & -i) fen[i]++; // start from index 1
// for (i = pos; i; i -= i & -i) ans += fen[i];

// let p = [2];
// for (let i = 3; i < 1e5; i += 2) {
//   let j, x = Math.sqrt(i);
//   for (j = 0; p[j] <= x; j++) if (i % p[j] == 0) break;
//   if (i % p[j] != 0) p.push(i);
// }

// let root = x => par[x] < 0 ? x : (par[x] = root(par[x]));
// let dsu = (x, y) => {
//   if ((x = root(x)) == (y = root(y))) return;
//   if (par[y] < par[x]) [x, y] = [y, x];
//   par[x] += par[y];
//   par[y] = x;
// }

let input = '';
process.stdin.on('data', c => input += c);
process.stdin.on('end', main);
function main() {
  let inp = input.split(/\s+/).map(v => +v), _i = 0, $ = n => n != null ? inp.slice(_i, _i += n) : inp[_i++],
    out = [], log = console.log, asc = (a, b) => a - b, desc = (a, b) => b - a, min = Math.min, max = Math.max, abs = Math.abs;
  let t = $()
  while (t--) {
    let a = $(3).sort(asc)
    log(a.sum()-1)
  }
}

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

const readline = require('readline');

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

let data = [];
rl.on('line', (input) => {
   data.push(input);
});

rl.on('close', () => {
   solve(data);
});

function solve(data) {

   for (let i = 1; i < data.length; i++) {
      [a, b, c] = data[i].split(" ").map((x) => parseInt(x));

      // Assume a, b, c are the shortest sides
      // The sum of the lengths of the shortest three sides of a quadrilateral must be longer than the longest side.

      console.log(a + b + c - 1);

   }

}

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

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

function main() {
  let t = +readLine();
  while (t--) {
    const arr = readLine()
      .split(" ")
      .map((n) => parseInt(n));

    arr.sort((a, b) => a - b);
    console.log(arr[2] + 1);
  }
}

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() {
  var T = +readLine();
  while (T--) {
    var [a, b, c] = readLine()
      .split(" ")
      .map((n) => BigInt(n));

    var ans = "";
    var sum = a + b + c;
    sum = sum - 1n;
    ans += sum;
    console.log(ans);
  }
}

var ti = parseInt(readline());
while(ti-- > 0) {
  var a = readline().split(' ').map(x => parseInt(x));
  print(Math.max(...a));
}

var n = parseInt(readline());

function trans(v) {
        return parseInt(v);
}

function comp(a, b) {
        return a - b > 0 ? -1 : 1
}
while(n--) {
        var arr = readline().split(' ').map(trans);
        arr.sort(comp);
        print(arr[0] + arr[2] - arr[1]);
}

var tc = parseInt(readline()),
    arr,
    a,
    b,
    c,
    x,
    y;

while (tc > 0) {
    arr = readline().split(' ');
    a = parseInt(arr[0]);
    b = parseInt(arr[1]);
    c = parseInt(arr[2]);

    x = Math.sqrt(a * a + (b - c) * (b - c));
    y = Math.sqrt(a * a + (b + c) * (b + c));

    print(Math.ceil(x + 1e-9));

    tc--;
}

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

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

function main() {
  let t = +readLine();
  while (t--) {
    const [a, b, c] = readLine()
      .split(" ")
      .map((n) => parseInt(n));

    console.log(b);
  }
}

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

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

function main() {
  let t = +readLine();
  while (t--) {
    const [a, b, c] = readLine()
      .split(" ")
      .map((n) => BigInt(n));

    let ans = "";
    const sum = a + b + c;

    for (let i = 1; i < 1e5; i++) {
      if (sum > i && BigInt(i) !== a && BigInt(i) !== b && BigInt(i) !== c) {
        ans += BigInt(i);
        console.log(ans);
        break;
      }
    }
  }
}

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

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

function main() {
  let t = +readLine();
  while (t--) {
    const [a, b, c] = readLine()
      .split(" ")
      .map((n) => BigInt(n));

    let ans = "";
    const sum = a + b + c;

    ans += sum - a;
    console.log(ans);
  }
}

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

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

function main() {
  let t = +readLine();
  while (t--) {
    const arr = readLine()
      .split(" ")
      .map((n) => parseInt(n));

    arr.sort((a, b) => a - b);
    console.log(arr[1]);
  }
}

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

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

function main() {
  let t = +readLine();
  while (t--) {
    const [a, b, c] = readLine()
      .split(" ")
      .map((n) => BigInt(n));

    let ans = "";
    const sum = a + b + c;

    for (let i = 1; i < 1e5; i++) {
      if (sum > i) {
        ans += i;
        console.log(ans);
        break;
      }
    }
  }
}

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() {
  var T = +readLine();
  while (T--) {
    var value = readLine().split(" ").map(Number);
    var a = value[0],
      b = value[1],
      c = value[2],
      d;
    d = Math.pow(a, 2) + Math.pow(c, 2) - Math.pow(b, 2);
    // console.log(BigInt(d))
    console.log(BigInt(Math.floor(Math.sqrt(Math.abs(d)))));
  }
}

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() {
  var T = +readLine();
  while (T--) {
    var [a, b, c] = readLine()
      .split(" ")
      .map((n) => BigInt(n));

    var ans = "";
    var sum = c + 1n;
    sum += ans;
    console.log(sum);
  }
}

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() {
  var T = +readLine();
  while (T--) {
    var value = readLine().split(" ").map(Number);
    var a = value[0],
      b = value[1],
      c = value[2],
      d;
    d = Math.pow(a, 2) + Math.pow(c, 2) - Math.pow(b, 2);
    if (a > 100000000 || b > 100000000 || c > 100000000) {
      console.log(BigInt(Math.floor(Math.sqrt(Math.abs(d)))));
    }
    console.log(Math.floor(Math.sqrt(Math.abs(d))));
  }
}

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() {
  var T = +readLine();
  while (T--) {
    var value = readLine().split(" ").map(Number);
    var a = value[0],
      b = value[1],
      c = value[2],
      d;
    d = Math.pow(a, 2) + Math.pow(c, 2) - Math.pow(b, 2);
    console.log(Math.floor(Math.sqrt(d)));
  }
}

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() {
  var T = +readLine();
  while (T--) {
    var value = readLine().split(" ").map(Number);
    var a = value[0],
      b = value[1],
      c = value[2],
      d;
    d = Math.pow(a, 2) + Math.pow(c, 2) - Math.pow(b, 2);
    console.log(Math.floor(Math.pow(d, 0.5)));
  }
}

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() {
  var T = +readLine();
  while (T--) {
    var [a, b, c] = readLine()
      .split(" ")
      .map((n) => BigInt(n));

    var ans = "";
    var sum = c - 1n;
    sum += ans;
    console.log(sum);
  }
}

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() {
  var T = +readLine();
  while (T--) {
    var value = readLine().split(" ").map(Number);
    var a = value[0],
      b = value[1],
      c = value[2],
      d;
    d = Math.pow(a, 2) + Math.pow(c, 2) - Math.pow(b, 2);
    if (a > 100000000 || b > 100000000 || c > 100000000) {
      console.log(parseInt(BigInt(Math.floor(Math.sqrt(Math.abs(d))))));
    }
    console.log(Math.floor(Math.sqrt(Math.abs(d))));
  }
}

var n = parseInt(readline());

function trans(v) {
        return parseInt(v);
}

while(n--) {
        var arr = readline().split(' ').map(trans);
        arr.sort();
        print(arr[0] + arr[2]);
}

var n = parseInt(readline());

function trans(v) {
        return parseInt(v);
}

while(n--) {
        var arr = readline().split(' ').map(trans);
        arr.sort();
        print((arr[2] + arr[1] + 1) / 2 + 1);
}

var n = parseInt(readline());

function trans(v) {
        return parseInt(v);
}

while(n--) {
        var arr = readline().split(' ').map(trans);
        arr.sort();
        print(parseInt((arr[2] + arr[1] + 1) / 2 + 1));
}

var n = parseInt(readline());

function trans(v) {
        return parseInt(v);
}

while(n--) {
        var arr = readline().split(' ').map(trans);
        arr.sort();
        print(arr[0] + arr[1]);
}

var n = parseInt(readline());

function trans(v) {
        return parseInt(v);
}

while(n--) {
        var arr = readline().split(' ').map(trans);
        arr.sort();
        print(arr[1] + arr[3]);
}

var n = parseInt(readline());

function trans(v) {
        return parseInt(v);
}

function comp(a, b) {
        return a - b > 0 ? -1 : 1
}
while(n--) {
        var arr = readline().split(' ').map(trans);
        arr.sort();
        print(arr[1] + arr[3]);
}

var n = parseInt(readline());

function trans(v) {
        return parseInt(v);
}

while(n--) {
        var arr = readline().split(' ').map(trans);
        arr.sort();
        print(arr[2] + arr[0] - arr[1] );
}