While trading on his favorite exchange trader William realized that he found a vulnerability. Using this vulnerability he could change the values of certain internal variables to his advantage. To play around he decided to change the values of all internal variables from $a_1, a_2, \ldots, a_n$ to $-a_1, -a_2, \ldots, -a_n$. For some unknown reason, the number of service variables is always an even number.

William understands that with his every action he attracts more and more attention from the exchange's security team, so the number of his actions must not exceed $5000$ and after every operation no variable can have an absolute value greater than $10^{18}$. William can perform actions of two types for two chosen variables with indices $i$ and $j$, where $i < j$:

Perform assignment $a_i = a_i + a_j$

Perform assignment $a_j = a_j - a_i$

William wants you to develop a strategy that will get all the internal variables to the desired values.


-----Input-----

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 20$). Description of the test cases follows.

The first line of each test case contains a single even integer $n$ ($2 \le n \le 10^3$), which is the number of internal variables.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ $(1 \le a_i \le 10^9)$, which are initial values of internal variables.


-----Output-----

For each test case print the answer in the following format:

The first line of output must contain the total number of actions $k$, which the strategy will perform. Note that you do not have to minimize $k$. The inequality $k \le 5000$ must be satisfied.

Each of the next $k$ lines must contain actions formatted as "type i j", where "type" is equal to "1" if the strategy needs to perform an assignment of the first type and "2" if the strategy needs to perform an assignment of the second type. Note that $i < j$ should hold.

We can show that an answer always exists.


-----Examples-----

Input
2
4
1 1 1 1
4
4 3 1 2
Output
8
2 1 2
2 1 2
2 1 3
2 1 3
2 1 4
2 1 4
1 1 2
1 1 2
8
2 1 4
1 2 4
1 2 4
1 2 4
1 3 4
1 1 2
1 1 2
1 1 4


-----Note-----

For the first sample test case one possible sequence of operations is as follows:

"2 1 2". Values of variables after performing the operation: [1, 0, 1, 1]

"2 1 2". Values of variables after performing the operation: [1, -1, 1, 1]

"2 1 3". Values of variables after performing the operation: [1, -1, 0, 1]

"2 1 3". Values of variables after performing the operation: [1, -1, -1, 1]

"2 1 4". Values of variables after performing the operation: [1, -1, -1, 0]

"2 1 4". Values of variables after performing the operation: [1, -1, -1, -1]

"1 1 2". Values of variables after performing the operation: [0, -1, -1, -1]

"1 1 2". Values of variables after performing the operation: [-1, -1, -1, -1]

For the second sample test case one possible sequence of operations is as follows:

"2 1 4". Values of variables after performing the operation: [4, 3, 1, -2]

"1 2 4". Values of variables after performing the operation: [4, 1, 1, -2]

"1 2 4". Values of variables after performing the operation: [4, -1, 1, -2]

"1 2 4". Values of variables after performing the operation: [4, -3, 1, -2]

"1 3 4". Values of variables after performing the operation: [4, -3, -1, -2]

"1 1 2". Values of variables after performing the operation: [1, -3, -1, -2]

"1 1 2". Values of variables after performing the operation: [-2, -3, -1, -2]

"1 1 4". Values of variables after performing the operation: [-4, -3, -1, -2]

Source: codeforces | Difficulty: EASY
Tags: Constructive algorithms


Solutions:
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(n // 2 * 6)
	for i in range(1, n + 1, 2):
		for j in range(6):
			tmp = str(j % 2 + 1) + ' ' + str(i) + ' ' + str(i + 1)
			print(tmp)


def solve():
	N = int(input())
	arr = list(map(int, input().split()))
	print(3 * N)
	for i in range(0, N, 2):
		for k in range(0, 3):
			print(1, i + 1, i + 2)
			print(2, i + 1, i + 2)
for testis in range(int(input())):
	solve()


for _ in range(int(input())):
	n = int(input())
	l11 = list(map(int, input().split()))
	print(n // 2 * 6)
	for i in range(1, n + 1, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(3 * n)
	for i in range(n // 2):
		print(1, 2 * i + 1, 2 * i + 2)
		print(2, 2 * i + 1, 2 * i + 2)
		print(2, 2 * i + 1, 2 * i + 2)
		print(1, 2 * i + 1, 2 * i + 2)
		print(2, 2 * i + 1, 2 * i + 2)
		print(2, 2 * i + 1, 2 * i + 2)


from sys import stdin, stdout
import math, bisect, heapq
from collections import Counter, deque, defaultdict
L = lambda : list(map(int, stdin.readline().strip().split()))
I = lambda : int(stdin.readline().strip())
S = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()

def pr(a):
	return ''.join(list(map(str, a)))

def solve():
	n = I()
	a = L()
	print(3 * n)
	for i in range(1, n + 1, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
for _ in range(I()):
	solve()


t = int(input())
longitudes = []
cadenas = []
for i in range(t):
	longitudes.append(int(input()))
	cadena = [int(j) for j in input().split()]
	cadenas.append(cadena)
for i in range(t):
	print(3 * longitudes[i])
	for j in range(1, int(longitudes[i] / 2) + 1):
		print(1, 2 * j - 1, 2 * j)
		print(2, 2 * j - 1, 2 * j)
		print(1, 2 * j - 1, 2 * j)
		print(2, 2 * j - 1, 2 * j)
		print(1, 2 * j - 1, 2 * j)
		print(2, 2 * j - 1, 2 * j)


cases = int(input())
for _ in range(cases):
	num = int(input())
	arr = list(map(int, input().split()))
	print(num * 3)
	for i in range(1, num + 1, 2):
		for _ in range(3):
			print(1, i, i + 1)
			print(2, i, i + 1)


t = int(input())
for i in range(t):
	m = int(input())
	s = list(map(int, input().split()))
	a = m // 2
	print(m * 3, '\n')
	for i in range(1, m + 1, 2):
		e = 1 + i
		f = e - 1
		print(1, ' ', f, ' ', e, '\n')
		print(2, ' ', f, ' ', e, '\n')
		print(1, ' ', f, ' ', e, '\n')
		print(1, ' ', f, ' ', e, '\n')
		print(2, ' ', f, ' ', e, '\n')
		print(1, ' ', f, ' ', e, '\n')


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
import math as mt
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
mod = int(1000000000.0) + 7

def power(k, n):
	if n == 0:
		return 1
	if n % 2:
		return power(k, n - 1) * k % mod
	t = power(k, n // 2)
	return t * t % mod

def totalPrimeFactors(n):
	count = 0
	if n % 2 == 0:
		count += 1
		while n % 2 == 0:
			n //= 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			count += 1
			while n % i == 0:
				n //= i
		i += 2
	if n > 2:
		count += 1
	return count

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		ans = []
		for i in range(0, n, 2):
			ans.append([1, i, i + 1])
			ans.append([2, i, i + 1])
			ans.append([2, i, i + 1])
			ans.append([1, i, i + 1])
			ans.append([2, i, i + 1])
			ans.append([2, i, i + 1])
		print(len(ans))
		for i in ans:
			print(i[0], i[1] + 1, i[2] + 1)
	return
main()


import math
from functools import reduce
from math import comb
from collections import defaultdict
from sys import stdout
NO = 'NO'
YES = 'YES'
MOD = 1000000007
ALPH = 'abcdefghijklmnopqrstuvwxyz'

def input_int():
	return int(input())

def input_list():
	return input().split(' ')

def input_list_int():
	return list(map(int, input_list()))

def list_int_to_str(a, sep=' '):
	return sep.join((str(x) for x in a))
global_ans = []

def pr(a):
	global_ans.append(a)

def solve():
	n = input_int()
	a = input()
	t = n * 6
	pr(n * 3)
	for i in range(0, n, 2):
		pr('1 {} {}'.format(i + 1, i + 2))
		pr('2 {} {}'.format(i + 1, i + 2))
		pr('2 {} {}'.format(i + 1, i + 2))
		pr('1 {} {}'.format(i + 1, i + 2))
		pr('2 {} {}'.format(i + 1, i + 2))
		pr('2 {} {}'.format(i + 1, i + 2))
query_count = 1
query_count = input_int()
while query_count:
	query_count -= 1
	solve()
for global_ans_line in global_ans:
	print(global_ans_line)


n = int(input())
for i in range(n):
	k = int(input())
	l = list(map(int, input().split()))
	print(3 * k)
	for j in range(0, k, 2):
		print(1, '', j + 1, '', j + 2)
		print(2, '', j + 1, '', j + 2)
		print(1, '', j + 1, '', j + 2)
		print(2, '', j + 1, '', j + 2)
		print(1, '', j + 1, '', j + 2)
		print(2, '', j + 1, '', j + 2)


has = int(input())
for jeme in range(has):
	lol = int(input())
	l = list(map(int, input().split()))
	hass = lol // 2
	print(3 * lol)
	for i in range(1, lol + 1, 2):
		h1 = i
		h2 = i + 1
		print(1, h1, h2)
		print(2, h1, h2)
		print(1, h1, h2)
		print(1, h1, h2)
		print(2, h1, h2)
		print(1, h1, h2)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print(3 * n)
	for i in range(0, n, 2):
		tog = 1
		j = 0
		while j < 6:
			print(tog, i + 1, i + 2)
			if tog == 2:
				tog = 1
			else:
				tog += 1
			j += 1


import sys
from os import path
import math
import time
from collections import defaultdict
from sys import setrecursionlimit
setrecursionlimit(10 ** 8)
MOD = 10 ** 9 + 7
INT_MAX = 10 ** 9
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	no_prime = []
	count = 0
	for i in range(len(prime)):
		if prime[i]:
			count += 1
		no_prime.append(count)
	return no_prime

def test_case():
	t = int(input())
	for _ in range(t):
		n = int(input())
		arr = list(map(int, input().split()))
		print(n // 2 * 6)
		for i in range(1, n + 1, 2):
			print(1, i, i + 1)
			print(2, i, i + 1)
			print(1, i, i + 1)
			print(2, i, i + 1)
			print(1, i, i + 1)
			print(2, i, i + 1)
test_case()


for _ in range(int(input())):
	n = int(input())
	input()
	print(3 * n)
	for i in range(1, n, 2):
		for j in [1, 2] * 3:
			print(j, i, i + 1)


import os
import sys
from io import BytesIO, IOBase
import math
from collections import Counter

def a(x):
	print(3 * len(x))
	for i in range(0, len(x), 2):
		for j in range(3):
			print(f'2 {i + 1} {i + 2}')
			print(f'1 {i + 1} {i + 2}')

def main():
	q = int(parse_input())
	r = []
	for _ in range(q):
		n = int(parse_input())
		x = [int(i) for i in parse_input().split()]
		a(x)
parse_input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	n = int(input())
	arr = [int(w) for w in input().split(' ')]
	print(3 * n)
	for i in range(0, n, 2):
		print(2, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(j) for j in input().split()]
	ans = []
	for i in range(0, n, 2):
		a[i] = a[i] + a[i + 1]
		ans += [[1, i, i + 1]]
		a[i + 1] = a[i + 1] - a[i]
		ans += [[2, i, i + 1]]
		a[i] = a[i] + a[i + 1]
		ans += [[1, i, i + 1]]
		a[i + 1] = a[i + 1] - a[i]
		ans += [[2, i, i + 1]]
		a[i] = a[i] + a[i + 1]
		ans += [[1, i, i + 1]]
		a[i + 1] = a[i + 1] - a[i]
		ans += [[2, i, i + 1]]
	print(len(ans))
	for x in ans:
		print(x[0], x[1] + 1, x[2] + 1)


from io import BytesIO, IOBase
from math import sqrt
import sys, os
from os import path
inpl = lambda : list(map(int, input().split()))
inpm = lambda : map(int, input().split())
inpi = lambda : int(input())
inp = lambda : input()
(rev, ra, l) = (reversed, range, len)
P = print
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def B(n):
	return bin(n).replace('0b', '')

def factors(n):
	arr = []
	for i in ra(2, int(sqrt(n)) + 1):
		if n % i == 0:
			arr.append(i)
			if i * i != n:
				arr.append(int(n / i))
	return arr

def prime_factors(n):
	omap = {2: 0}
	while n != 1 and n % 2 == 0:
		omap[2] += 1
		n /= 2
	for i in ra(3, int(math.sqrt(n)) + 1, 2):
		while n != 1 and n % i == 0:
			if i not in omap:
				omap[i] = 1
			else:
				omap[i] += 1
			n /= i
	if n != 1:
		omap[int(n)] = 1
	return omap

def dfs(arr, n):
	pairs = [[i + 1] for i in ra(n)]
	vis = [0] * (n + 1)
	for i in ra(l(arr)):
		pairs[arr[i][0] - 1].append(arr[i][1])
	pairs[arr[i][1] - 1].append(arr[i][0])
	comp = []
	for i in ra(n):
		stack = [pairs[i]]
		temp = []
		if vis[stack[-1][0]] == 0:
			while len(stack) > 0:
				if vis[stack[-1][0]] == 0:
					temp.append(stack[-1][0])
					vis[stack[-1][0]] = 1
					s = stack.pop()
					for j in s[1:]:
						if vis[j] == 0:
							stack.append(pairs[j - 1])
				else:
					stack.pop()
			comp.append(temp)
	return comp
from bisect import bisect_left as bl
from bisect import bisect_right as br
import sys, operator, math, operator
from collections import Counter
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
import random
tc = inpi()
while tc:
	tc -= 1
	n = inpi()
	li = inpl()
	P(int(6 * (n // 2)))
	for i in ra(0, n, 2):
		P(1, i + 1, i + 2)
		P(2, i + 1, i + 2)
		P(1, i + 1, i + 2)
		P(1, i + 1, i + 2)
		P(2, i + 1, i + 2)
		P(1, i + 1, i + 2)


import sys
from sys import stdin

def q(ty, i, j):
	ans.append((ty, i + 1, j + 1))
	if ty == 1:
		a[i] = a[i] + a[j]
	else:
		a[j] = a[j] - a[i]
tt = int(stdin.readline())
for loop in range(tt):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	ans = []
	for i in range(0, n, 2):
		for j in range(2):
			q(1, i, i + 1)
			q(2, i, i + 1)
			q(1, i, i + 1)
	print(len(ans))
	for i in ans:
		print(*i)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(6 * (n // 2))
	for i in range(0, n, 2):
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)


from collections import deque

def recur(i, j):
	dq = deque([(li[i], li[j], [])])
	while True:
		(a, b, cur) = dq.popleft()
		dq.append([a + b, b, cur + [[1, i, j]]])
		dq.append([a, b - a, cur + [[2, i, j]]])
		if -a == li[i] and -b == li[j]:
			return cur
for _ in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	ret = []
	for i in range(0, n, 2):
		ret.extend(recur(i, i + 1))
	print(len(ret))
	for n in ret:
		(t, a, b) = n
		print(t, a + 1, b + 1)


import sys
import bisect
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ans = []
	for i in range(1, n + 1, 2):
		ans.append([1, i, i + 1])
		ans.append([2, i, i + 1])
		ans.append([2, i, i + 1])
		ans.append([1, i, i + 1])
		ans.append([2, i, i + 1])
		ans.append([2, i, i + 1])
	print(len(ans))
	for x in ans:
		print(*x)


import math, sys
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
MOD = int(1000000000.0) + 7
INF = float('inf')

def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	(l, r) = (1, n)
	print(3 * n)
	while l < r:
		print(2, l, r)
		print(1, l, r)
		print(1, l, r)
		print(2, l, r)
		print(1, l, r)
		print(1, l, r)
		l += 1
		r -= 1
ts = 1
ts = int(input())
for t in range(1, ts + 1):
	solve()


def solve():
	n = int(input())
	l = list(map(int, input().split()))
	n //= 2
	k = n
	l1 = []
	j = 1
	for i in range(k):
		l1.append([1, j, j + 1])
		l1.append([2, j, j + 1])
		l1.append([1, j, j + 1])
		l1.append([1, j, j + 1])
		l1.append([2, j, j + 1])
		l1.append([1, j, j + 1])
		j += 2
	print(6 * k)
	for i in l1:
		print(*i)
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	N = int(input())
	arr = list(map(int, input().split()))
	K = 6 * (N // 2)
	print(K)
	for i in range(1, N, 2):
		(ai, aj) = (i, i + 1)
		print(1, ai, aj)
		print(2, ai, aj)
		print(2, ai, aj)
		print(1, ai, aj)
		print(2, ai, aj)
		print(2, ai, aj)


import os, sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
mod = 998244353
from math import ceil, gcd, log2
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(3 * n)
	for i in range(1, n, 2):
		f = i
		s = i + 1
		print(1, f, s)
		print(2, f, s)
		print(1, f, s)
		print(2, f, s)
		print(1, f, s)
		print(2, f, s)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	a = [int(x) for x in input().split()]
	ops = [1, 2, 1, 1, 2, 1]
	print(6 * n // 2)
	for i in range(0, n, 2):
		for j in range(len(ops)):
			print(ops[j], i + 1, i + 2)


import math
from collections import defaultdict
t = int(input())
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	curr = 1
	ans = []
	for j in range(n // 2):
		i1 = curr
		i2 = curr + 1
		ans.append([1, i1, i2])
		ans.append([2, i1, i2])
		ans.append([1, i1, i2])
		ans.append([1, i1, i2])
		ans.append([2, i1, i2])
		ans.append([1, i1, i2])
		curr += 2
	print(len(ans))
	for j in ans:
		print(*j)


t = int(input())
for _ in range(t):
	nn = int(input())
	l = list(map(int, input().split()))
	out = []
	for x in range(0, nn, +2):
		out.append(['1', str(x + 1), str(x + 2)])
		out.append(['2', str(x + 1), str(x + 2)])
		out.append(['2', str(x + 1), str(x + 2)])
		out.append(['1', str(x + 1), str(x + 2)])
		out.append(['2', str(x + 1), str(x + 2)])
		out.append(['2', str(x + 1), str(x + 2)])
	print(len(out))
	for x in out:
		print(' '.join(x))


def solve(n: int) -> None:
	arr = [2, 1, 2, 2, 1, 2]
	print(3 * n)
	for i in range(1, n + 1, 2):
		for j in arr:
			print(j, i, i + 1)
t = int(input())
for _ in range(t):
	n = int(input())
	input()
	solve(n)


for i in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	b = []
	for j in range(0, n, 2):
		if li[j] < li[j + 1]:
			b.append(6)
		if li[j] == li[j + 1]:
			b.append(4)
		if li[j] > li[j + 1]:
			b.append(6)
	print(sum(b))
	for j in range(0, n, 2):
		if li[j] < li[j + 1]:
			print(2, j + 1, j + 2)
			print(1, j + 1, j + 2)
			print(2, j + 1, j + 2)
			print(1, j + 1, j + 2)
			print(2, j + 1, j + 2)
			print(1, j + 1, j + 2)
		if li[j] == li[j + 1]:
			print(2, j + 1, j + 2)
			print(2, j + 1, j + 2)
			print(1, j + 1, j + 2)
			print(1, j + 1, j + 2)
		if li[j] > li[j + 1]:
			print(2, j + 1, j + 2)
			print(1, j + 1, j + 2)
			print(2, j + 1, j + 2)
			print(1, j + 1, j + 2)
			print(2, j + 1, j + 2)
			print(1, j + 1, j + 2)


from collections import Counter

def getlist():
	return list(map(int, input().split()))

def main():
	t = int(input())
	for num in range(t):
		n = int(input())
		arr = getlist()
		print(6 * (n // 2))
		number = 1
		while number < n:
			i = 1
			for typ in range(6):
				if i == 1:
					print(i, number, number + 1)
					i = 2
				else:
					print(i, number, number + 1)
					i = 1
			number += 2
main()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	ans = []
	for i in range(0, n, 2):
		ans.append((1, i + 1, i + 2))
		ans.append((2, i + 1, i + 2))
		ans.append((2, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
		ans.append((2, i + 1, i + 2))
		ans.append((2, i + 1, i + 2))
	print(len(ans))
	for i in ans:
		print(*i)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(6 * (n // 2))
	for k in range(n // 2):
		i = 2 * k
		print(str(1) + ' ' + str(i + 1) + ' ' + str(i + 2))
		print(str(2) + ' ' + str(i + 1) + ' ' + str(i + 2))
		print(str(1) + ' ' + str(i + 1) + ' ' + str(i + 2))
		print(str(2) + ' ' + str(i + 1) + ' ' + str(i + 2))
		print(str(1) + ' ' + str(i + 1) + ' ' + str(i + 2))
		print(str(2) + ' ' + str(i + 1) + ' ' + str(i + 2))


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print(n // 2 * 6)
	for j in range(0, n, 2):
		print(1, j + 1, j + 2)
		print(2, j + 1, j + 2)
		print(1, j + 1, j + 2)
		print(2, j + 1, j + 2)
		print(1, j + 1, j + 2)
		print(2, j + 1, j + 2)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	i = 1
	s = 3 * n
	print(s)
	while i <= n // 2:
		print(1, i, n - i + 1)
		print(2, i, n - i + 1)
		print(1, i, n - i + 1)
		print(1, i, n - i + 1)
		print(2, i, n - i + 1)
		print(1, i, n - i + 1)
		i = i + 1


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	print(3 * n)
	for i in range(0, n, 2):
		first = str(i + 1)
		second = str(i + 2)
		print('1 ' + first + ' ' + second)
		print('1 ' + first + ' ' + second)
		print('2 ' + first + ' ' + second)
		print('1 ' + first + ' ' + second)
		print('1 ' + first + ' ' + second)
		print('2 ' + first + ' ' + second)


import collections
q = int(input())
ans_amount = []
ans_ops = []
for _ in range(q):
	n = int(input())
	nums = list(map(int, input().split()))
	ans_amount += [n * 3]
	operations = []
	for i in range(1, n + 1, 2):
		operations += [[2, i, i + 1], [1, i, i + 1], [2, i, i + 1]] * 2
	ans_ops.append(operations)
for que in range(q):
	print(ans_amount[que])
	for line in ans_ops[que]:
		print(' '.join(map(str, line)))


t = int(input())
for _ in range(t):
	n = int(input())
	m = [int(i) for i in input().split()]
	print(n + n + n)
	for i in range(1, n + 1, 2):
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(1, i, i + 1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(n * 3)
	for i in range(0, n, 2):
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(2, i + 1, i + 2)


from __future__ import division, print_function
import math
import os
import sys
from fractions import *
from sys import *
from decimal import *
from io import BytesIO, IOBase
from itertools import accumulate, combinations, permutations, combinations_with_replacement, product
from collections import *
import timeit, time
M = 10 ** 9 + 7
import heapq
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchcount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def binarySearch(arr, n, key):
	left = 0
	right = n - 1
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] == key:
			return mid
		if arr[mid] <= key:
			left = mid + 1
		else:
			right = mid - 1
	return -1

def ternarysearch(arr, n, key):
	(l, r) = (0, n - 1)
	while l <= r:
		mid = (-l + r) // 3 + l
		mid2 = mid + (-l + r) // 3
		if arr[mid] == key:
			return mid
		if arr[mid2] == key:
			return mid2
		if arr[mid] > key:
			r = mid - 1
		elif arr[mid2] < key:
			l = mid2 + 1
		else:
			l = mid + 1
			r = mid2 - 1
	return -1

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def sumofdigits(n):
	n = str(n)
	s1 = 0
	for i in n:
		s1 += int(i)
	return s1

def perfect_square(n):
	s = math.sqrt(n)
	if s == int(s):
		return True
	return False

def roman_number(x):
	if x > 15999:
		return
	value = [5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
	symbol = ['F', 'MF', 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
	roman = ''
	i = 0
	while x > 0:
		div = x // value[i]
		x = x % value[i]
		while div:
			roman += symbol[i]
			div -= 1
		i += 1
	return roman

def soretd(s):
	for i in range(1, len(s)):
		if s[i - 1] > s[i]:
			return False
	return True

def countRhombi(h, w):
	ct = 0
	for i in range(2, h + 1, 2):
		for j in range(2, w + 1, 2):
			ct += (h - i + 1) * (w - j + 1)
	return ct

def countrhombi2(h, w):
	return h * h // 4 * (w * w // 4)

def binpow(a, b):
	if b == 0:
		return 1
	else:
		res = binpow(a, b // 2)
	if b % 2 != 0:
		return res * res * a
	else:
		return res * res

def binpowmodulus(a, b, m):
	a %= m
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b >>= 1
	return res

def coprime_to_n(n):
	result = n
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			result -= result // i
		i += 1
	if n > 1:
		result -= result // n
	return result

def luckynumwithequalnumberoffourandseven(x, n, a):
	if x >= n and str(x).count('4') == str(x).count('7'):
		a.append(x)
	elif x < 1000000000000.0:
		luckynumwithequalnumberoffourandseven(x * 10 + 4, n, a)
		luckynumwithequalnumberoffourandseven(x * 10 + 7, n, a)
	return a

def luckynum(x, l, r, a):
	if x >= l and x <= r:
		a.append(x)
	if x > r:
		a.append(x)
		return a
	if x < 10000000000.0:
		luckynum(x * 10 + 4, l, r, a)
		luckynum(x * 10 + 7, l, r, a)
	return a

def luckynuber(x, n, a):
	p = set(str(x))
	if len(p) <= 2:
		a.append(x)
	if x < n:
		luckynuber(x + 1, n, a)
	return a

def interact(type, x):
	if type == 'r':
		inp = input()
		return inp.strip()
	else:
		print(x, flush=True)

def findTrailingZeros(n):
	count = 0
	while n >= 5:
		n //= 5
		count += n
	return count

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1
res = set()

def solven(p, l, a, b, n):
	if p > n or l > 10:
		return
	if p > 0:
		res.add(p)
	solven(p * 10 + a, l + 1, a, b, n)
	solven(p * 10 + b, l + 1, a, b, n)

def subsetsUtil(A, subset, index, d):
	print(*subset)
	s = sum(subset)
	d.append(s)
	for i in range(index, len(A)):
		subset.append(A[i])
		subsetsUtil(A, subset, i + 1, d)
		subset.pop(-1)
	return d

def subsetSums(arr, l, r, d, sum=0):
	if l > r:
		d.append(sum)
		return
	subsetSums(arr, l + 1, r, d, sum + arr[l])
	subsetSums(arr, l + 1, r, d, sum)
	return d

def print_factors(x):
	factors = []
	for i in range(1, x + 1):
		if x % i == 0:
			factors.append(i)
	return factors

def calc(X, d, ans, D):
	if len(X) == 0:
		return
	i = X.index(max(X))
	ans[D[max(X)]] = d
	Y = X[:i]
	Z = X[i + 1:]
	calc(Y, d + 1, ans, D)
	calc(Z, d + 1, ans, D)

def factorization(n, l):
	c = n
	if prime(n) == True:
		l.append(n)
		return l
	for i in range(2, c):
		if n == 1:
			break
		while n % i == 0:
			l.append(i)
			n = n // i
	return l

def good(b):
	l = []
	i = 0
	while len(b) != 0:
		if b[i] < b[len(b) - 1 - i]:
			l.append(b[i])
			b.remove(b[i])
		else:
			l.append(b[len(b) - 1 - i])
			b.remove(b[len(b) - 1 - i])
	if l == sorted(l):
		return True
	return False

def generate(st, s):
	if len(s) == 0:
		return
	if s not in st:
		st.add(s)
		for i in range(len(s)):
			t = list(s).copy()
			t.remove(s[i])
			t = ''.join(t)
			generate(st, t)
	return

def largestincreasingsubsequence(A):
	l = [1] * len(A)
	sub = []
	for i in range(1, len(l)):
		for k in range(i):
			if A[k] < A[i]:
				sub.append(l[k])
		l[i] = 1 + max(sub, default=0)
	return max(l, default=0)

def findOR(nums, N):
	prefix_sum = 0
	result = 0
	for i in range(N):
		result |= nums[i]
		prefix_sum += nums[i]
		result |= prefix_sum
	return result

def OR(a, n):
	ans = a[0]
	for i in range(1, n):
		ans |= a[i]
	return ans

def toString(List):
	return ''.join(List)

def permute(a, l, r, p):
	if l == r:
		p.append(toString(a))
	else:
		for i in range(l, r + 1):
			(a[l], a[i]) = (a[i], a[l])
			permute(a, l + 1, r, p)
			(a[l], a[i]) = (a[i], a[l])

def squareRoot(number, precision):
	start = 0
	(end, ans) = (number, 1)
	while start <= end:
		mid = int((start + end) / 2)
		if mid * mid == number:
			ans = mid
			break
		if mid * mid < number:
			start = mid + 1
		else:
			end = mid - 1
	increment = 0.1
	for i in range(0, precision):
		while ans * ans <= number:
			ans += increment
		ans = ans - increment
		increment = increment / 10
	return ans

def countRectangles(l, w):
	squareSide = math.gcd(l, w)
	return int(l * w / (squareSide * squareSide))

def count_same_digit(L, R):
	tmp = 0
	ans = 0
	n = int(math.log10(R) + 1)
	for i in range(0, n):
		tmp = tmp * 10 + 1
		for j in range(1, 10):
			if L <= tmp * j and tmp * j <= R:
				ans += 1
	return ans

def findCrossOver(arr, low, high, x):
	if arr[high] <= x:
		return high
	if arr[low] > x:
		return low
	mid = (low + high) // 2
	if arr[mid] <= x and arr[mid + 1] > x:
		return mid
	if arr[mid] < x:
		return findCrossOver(arr, mid + 1, high, x)
	return findCrossOver(arr, low, mid - 1, x)

def Kclosest(arr, x, k, n, ans):
	l = findCrossOver(arr, 0, n - 1, x)
	r = l + 1
	count = 0
	if arr[l] == x:
		l -= 1
	while l >= 0 and r < n and (count < k):
		if x - arr[l] < arr[r] - x:
			ans.append(arr[l])
			l -= 1
		else:
			ans.append(arr[r])
			r += 1
		count += 1
	while count < k and l >= 0:
		ans.append(arr[l])
		l -= 1
		count += 1
	while count < k and r < n:
		ans.append(arr[r])
		r += 1
		count += 1
	return ans

def prime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			return False
	return True

def calcSum(arr, n, k):
	l = []
	sum = 0
	for i in range(k):
		sum += arr[i]
	l.append(sum)
	for i in range(k, n):
		sum = sum - arr[i - k] + arr[i]
		l.append(sum)
	return l

def dfs(root, nodeVal, nodeConnection, visited):
	leftVal = nodeVal[root][0]
	rightVal = nodeVal[root][1]
	solution = []
	if nodeConnection[root]:
		visited.add(root)
		for i in nodeConnection[root]:
			if i not in visited:
				solution.append(dfs(i, nodeVal, nodeConnection, visited))
		leftMax = 0
		rightMax = 0
		for i in solution:
			(l, r) = i
			leftMax += max(abs(leftVal - l[0]) + l[1], abs(leftVal - r[0]) + r[1])
			rightMax += max(abs(rightVal - l[0]) + l[1], abs(rightVal - r[0]) + r[1])
		return ((leftVal, leftMax), (rightVal, rightMax))
	else:
		return ((leftVal, 0), (rightVal, 0))

def luckynumber(x, n, a):
	if x > 0:
		a.append(x)
	if x > 10 ** 9:
		return a
	elif x < 1000000000000.0:
		luckynumber(x * 10 + 4, n, a)
		luckynumber(x * 10 + 7, n, a)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def query(l, r):
	if l >= r:
		return -1
	print('?', l + 1, r + 1)
	sys.stdout.flush()
	return int(input()) - 1

def answer(p):
	print('!', p + 1)
	sys.stdout.flush()
	exit()

def main():
	for _ in range(int(input())):
		n = int(input())
		arr = list(map(int, input().split()))
		ans = []
		i = 0
		while i < n:
			ans.append([2, i + 1, i + 2])
			ans.append([1, i + 1, i + 2])
			ans.append([1, i + 1, i + 2])
			ans.append([2, i + 1, i + 2])
			ans.append([1, i + 1, i + 2])
			ans.append([1, i + 1, i + 2])
			i += 2
		print(len(ans))
		for i in ans:
			print(*i)
main()


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	n = Int()
	ans = []
	a = array()
	for i in range(0, n, 2):
		ans.append((2, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
		ans.append((2, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
	print(len(ans))
	for i in ans:
		print(*i)


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	print(n * 3)
	for i in range(0, n, 2):
		for j in range(3):
			print(1, i + 1, i + 2)
			print(2, i + 1, i + 2)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(3 * n)
	for i in range(n // 2):
		j = n - i - 1
		for k in range(3):
			print(1, i + 1, j + 1, '\n', 2, i + 1, j + 1)


for tc in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(3 * n)
	for i in range(1, n, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)


t = int(input())

def ao(a, i, j):
	a[i] = a[i] + a[j]
ao.t = 1

def at(a, i, j):
	a[j] = a[j] - a[i]
at.t = 2

def reverse_values(a):
	seq = [ao, at, ao, at, ao, at]
	for i in range(0, len(a), 2):
		for s in seq:
			s(a, i, i + 1)
			print(f'{s.t} {i + 1} {i + 2}')
for _ in range(t):
	n = int(input())
	a_vec = input().split(' ')
	a_vec = [int(a) for a in a_vec]
	print(f'{3 * n}')
	reverse_values(a_vec)


inp = int(input())
for _ in range(inp):
	n = int(input())
	a = list(map(int, input().split(' ')))
	print(3 * len(a))
	for i in range(0, len(a), 2):
		p = [[2, i + 1, i + 2], [2, i + 1, i + 2], [1, i + 1, i + 2]]
		for _ in range(2):
			for j in p:
				print(*j)


import collections
import functools
import math
import sys
import bisect

def In():
	return map(int, sys.stdin.readline().split())
input = sys.stdin.readline

def lord():
	for _ in range(int(input())):
		n = int(input())
		l = input()
		print(n // 2 * 6)
		for i in range(0, n, 2):
			for i1 in range(6):
				print(i1 % 2 + 1, i + 1, i + 2)
lord()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(n * 3)
	for i in range(0, n, 2):
		x = ' ' + str(i + 1) + ' ' + str(i + 2)
		for j in range(6):
			print(str(2 - j % 2) + x)


import sys, os.path, math
from collections import defaultdict, deque
if os.path.exists('amz42.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for _ in range(int(input().strip(' '))):
	n = int(input().strip(' '))
	l = [int(x) for x in input().strip(' ').split(' ')]
	print(n // 2 * 6)
	for i in range(1, n, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)


t = int(input())
while t > 0:
	n = int(input())
	v = list(map(int, input().split()))
	print(n * 3)
	for j in range(0, n, 2):
		i = j + 1
		print('1 ' + str(i) + ' ' + str(i + 1))
		print('2 ' + str(i) + ' ' + str(i + 1))
		print('1 ' + str(i) + ' ' + str(i + 1))
		print('2 ' + str(i) + ' ' + str(i + 1))
		print('1 ' + str(i) + ' ' + str(i + 1))
		print('2 ' + str(i) + ' ' + str(i + 1))
	t = t - 1


a = int(input())
import sys
input = sys.stdin.readline
for i in range(a):
	n = int(input())
	z = list(map(int, input().split()))
	print(3 * len(z))
	for i in range(0, len(z), 2):
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)


import sys
import math
input = sys.stdin.readline
imp = 'IMPOSSIBLE'
t = int(input())
for test in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	print(3 * n)
	for i in range(n // 2):
		print('2 ' + str(2 * i + 1) + ' ' + str(2 * i + 2))
		print('1 ' + str(2 * i + 1) + ' ' + str(2 * i + 2))
		print('1 ' + str(2 * i + 1) + ' ' + str(2 * i + 2))
		print('2 ' + str(2 * i + 1) + ' ' + str(2 * i + 2))
		print('1 ' + str(2 * i + 1) + ' ' + str(2 * i + 2))
		print('1 ' + str(2 * i + 1) + ' ' + str(2 * i + 2))


import os
import sys
from bisect import bisect_right
from io import BytesIO, IOBase
from math import gcd, inf, sqrt, ceil

def lcm(a, b):
	return a * b // gcd(a, b)

def sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(sqrt(MAXN))):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def getFactorization(x):
	ret = Counter()
	while x != 1:
		ret[spf[x]] += 1
		x = x // spf[x]
	return ret

def printDivisors(n):
	i = 2
	z = [1, n]
	while i <= sqrt(n):
		if n % i == 0:
			if n / i == i:
				z.append(i)
			else:
				z.append(i)
				z.append(n // i)
		i = i + 1
	return z

def create(n, x, f):
	pq = len(bin(n)[2:])
	if f == 0:
		tt = min
	else:
		tt = max
	dp = [[inf] * n for _ in range(pq)]
	dp[0] = x
	for i in range(1, pq):
		for j in range(n - (1 << i) + 1):
			dp[i][j] = tt(dp[i - 1][j], dp[i - 1][j + (1 << i - 1)])
	return dp

def enquiry(l, r, dp, f):
	if l > r:
		return inf if not f else -inf
	if f == 1:
		tt = max
	else:
		tt = min
	pq1 = len(bin(r - l + 1)[2:]) - 1
	return tt(dp[pq1][l], dp[pq1][r - (1 << pq1) + 1])

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	x = []
	for i in range(2, n + 1):
		if prime[i]:
			x.append(i)
	return x

def main():
	for _ in range(int(input())):
		n = int(input())
		a = [int(x) for x in input().split()]
		print(6 * (n // 2))
		for i in range(0, n, 2):
			print(1, i + 1, i + 2)
			print(2, i + 1, i + 2)
			print(1, i + 1, i + 2)
			print(2, i + 1, i + 2)
			print(1, i + 1, i + 2)
			print(2, i + 1, i + 2)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from __future__ import division, print_function
import bisect
import math
import heapq
import itertools
import sys
from collections import deque
from atexit import register
from collections import Counter
from functools import reduce
if sys.version_info[0] < 3:
	from io import BytesIO as stream
else:
	from io import StringIO as stream
if sys.version_info[0] < 3:

	class dict(dict):

		def items(self):
			return dict.iteritems(self)

		def keys(self):
			return dict.iterkeys(self)

		def values(self):
			return dict.itervalues(self)
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip

def sync_with_stdio(sync=True):
	global input, flush
	if sync:
		flush = sys.stdout.flush
	else:
		sys.stdin = stream(sys.stdin.read())
		input = lambda : sys.stdin.readline().rstrip('\r\n')
		sys.stdout = stream()
		register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(n // 2 * 6)
	for i in range(1, n // 2 + 1):
		for j in range(6):
			if j % 2 == 0:
				print(1, i * 2 - 1, i * 2)
			else:
				print(2, i * 2 - 1, i * 2)


def test():
	n = int(input())
	arr = list(map(int, input().split()))
	opts = int(n / 2 * 6)
	print(opts)
	for i in range(1, n + 1, 2):
		for _ in range(3):
			print(f'1 {i} {i + 1}')
			print(f'2 {i} {i + 1}')
num_cases = int(input())
for _ in range(0, num_cases):
	test()


import math
from collections import Counter
from itertools import permutations, combinations
import fractions

def show(a, b):
	print(1, a, b)
	print(1, a, b)
	print(2, a, b)
	print(1, a, b)
	print(1, a, b)
	print(2, a, b)

def solve(test):
	n = int(input())
	a = [int(s) for s in input().split(' ')]
	print(3 * n)
	for i in range(n // 2):
		first = i
		last = n - i - 1
		show(first + 1, last + 1)
t = int(input())
for _ in range(t):
	solve(_ + 1)


for _ in range(int(input())):
	n = int(input())
	ans = n // 2 * 6
	a = [int(x) for x in input().split()]
	print(ans)
	for i in range(0, n, 2):
		for n in range(3):
			print(2, i + 1, i + 2)
			print(1, i + 1, i + 2)


import math, sys, heapq
for t in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	ans = []
	for i in range(1, n + 1, 2):
		for j in range(3):
			ans.append([1, i, i + 1])
			ans.append([2, i, i + 1])
			a[i - 1] = a[i - 1] + a[i]
			a[i] = a[i] - a[i - 1]
	print(len(ans))
	for i in ans:
		print(*i)


a = '2 {0} {1}\n1 {0} {1}'
for _ in range(int(input())):
	n = int(input())
	l = input()
	print(n * 3)
	for i in range(0, n, 2):
		for _ in range(3):
			print(a.format(i + 1, i + 2))


t = int(input())
for i in range(t):
	n = int(input())
	s = list(map(int, input().split()))
	print(int(6 * (n / 2)))
	for i in range(0, len(s), +2):
		for j in range(6):
			if j % 2 == 1:
				print('2', i + 1, i + 2)
			else:
				print('1', i + 1, i + 2)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(n // 2 * 6)
	x = 1
	y = 2
	for i in range(n // 2):
		print(2, x, y)
		print(1, x, y)
		print(1, x, y)
		print(2, x, y)
		print(1, x, y)
		print(1, x, y)
		x += 2
		y += 2


def solve(n, arr):
	print(6 * (n // 2))
	for i in range(0, n, 2):
		print('1 ' + str(i + 1) + ' ' + str(i + 2) + ' ')
		print('2 ' + str(i + 1) + ' ' + str(i + 2) + ' ')
		print('1 ' + str(i + 1) + ' ' + str(i + 2) + ' ')
		print('1 ' + str(i + 1) + ' ' + str(i + 2) + ' ')
		print('2 ' + str(i + 1) + ' ' + str(i + 2) + ' ')
		print('1 ' + str(i + 1) + ' ' + str(i + 2) + ' ')
T = int(input())
while T:
	n = int(input())
	arr = [int(x) for x in input().split()]
	solve(n, arr)
	T -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(n * 3)
	for i in range(1, n + 1, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)


import math

def solve():
	n = int(input())
	l = list(map(int, input().split()))
	tmp = n // 2
	print(3 * n)
	for i in range(1, n + 1, 2):
		x = i
		y = i + 1
		print(1, x, y)
		print(2, x, y)
		print(1, x, y)
		print(1, x, y)
		print(2, x, y)
		print(1, x, y)
t = int(input())
for z in range(t):
	solve()


import os
import sys
from io import BytesIO, IOBase

def main():
	tc = int(input())
	for _ in range(tc):
		n = int(input())
		a = [int(x) for x in input().split()]
		i = 1
		j = n
		print(n // 2 * 6)
		for k in range(n // 2):
			print(2, i, j)
			print(2, i, j)
			print(1, i, j)
			print(2, i, j)
			print(2, i, j)
			print(1, i, j)
			i += 1
			j -= 1
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def solve():
	ans = []
	for i in range(0, N, 2):
		ans.append((2, i + 1, i + 2))
	for i in range(0, N, 2):
		ans.append((1, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
	for i in range(0, N, 2):
		ans.append((2, i + 1, i + 2))
	for i in range(0, N, 2):
		ans.append((1, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
	return ans
test_cases = int(input())
for test_case in range(test_cases):
	N = int(input())
	A = list(map(int, input().split()))
	result = solve()
	print(len(result))
	for row in result:
		print(*row)


def operations(i, j):
	print(1, i, j)
	print(2, i, j)
	print(2, i, j)
	print(1, i, j)
	print(2, i, j)
	print(2, i, j)
for _ in range(int(input())):
	n = int(input())
	a = input()
	print(n // 2 * 6)
	for i in range(1, n, 2):
		j = i + 1
		for _ in range(2):
			print(1, i, j)
			print(2, i, j)
			print(2, i, j)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	ans = []
	for i in range(0, n, 2):
		j = i + 1
		ans.extend([[1, i + 1, j + 1], [2, i + 1, j + 1], [1, i + 1, j + 1], [1, i + 1, j + 1], [2, i + 1, j + 1], [1, i + 1, j + 1]])
	print(len(ans))
	for i in ans:
		print(*i)


def solution(n, a):
	print(len(a) // 2 * 6)
	for i in range(1, len(a), 2):
		print('1 {} {}'.format(i, i + 1))
		print('2 {} {}'.format(i, i + 1))
		print('1 {} {}'.format(i, i + 1))
		print('2 {} {}'.format(i, i + 1))
		print('1 {} {}'.format(i, i + 1))
		print('2 {} {}'.format(i, i + 1))
t = int(input())
for tt in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	solution(n, a)


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	a = input()
	print(n * 3)
	for i in range(1, n + 1, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
for i in range(int(input())):
	solve()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	o = 3 * len(l)
	print(o)
	for i in range(1, n, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)


import sys
input = sys.stdin.readline
t = int(input())
for you in range(t):
	n = int(input())
	l = input().split()
	print(3 * n)
	for i in range(n // 2):
		a = 2 * i + 1
		b = 2 * i + 2
		print(1, a, b)
		print(2, a, b)
		print(1, a, b)
		print(2, a, b)
		print(1, a, b)
		print(2, a, b)


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	print(3 * n)
	for j in range(1, n, 2):
		print(f'1 {j} {j + 1}\n2 {j} {j + 1}\n1 {j} {j + 1}\n1 {j} {j + 1}\n2 {j} {j + 1}\n1 {j} {j + 1}')


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
from collections import defaultdict as dd
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
stdmap = lambda : map(int, stdstr().split())
stdarr = lambda : list(map(int, stdstr().split()))
mod = 1000000007

def f(arr, i, j):
	arr[i] = arr[i] + arr[j]

def s(arr, i, j):
	arr[j] = arr[j] - arr[i]
for _ in range(stdint()):
	n = stdint()
	arr = stdarr()
	res = []
	for i in range(0, n, 2):
		(x, y) = (i + 1, i + 2)
		res.append([1, x, y])
		res.append([2, x, y])
		res.append([2, x, y])
		res.append([1, x, y])
		res.append([2, x, y])
		res.append([2, x, y])
	print(len(res))
	for i in res:
		print(*i)


import sys
from sys import stdout
import io, os
P = lambda : list(map(int, input().split()))
from math import factorial as f
from collections import deque, defaultdict as dd
from heapq import heapify, heappop, heappush, heappushpop, heapreplace, merge
mod = 10 ** 9 + 7
a = ord('a')

def fast_exp(x, exp):
	ans = 1
	base = x
	while exp:
		if exp & 1:
			ans *= base
		base *= base
		base %= mod
		ans %= mod
		exp >>= 1
	return ans

def solve():
	n = int(input())
	l = P()
	print(3 * n)
	for i in range(1, n + 1, 2):
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
tc = int(input())
for t in range(1, tc + 1):
	solve()


t = int(input())

def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	print(n * 3)
	for i in range(1, n + 1, 2):
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
for i in range(t):
	solve()


import sys
import string
from decimal import Decimal

def inp():
	return int(input())

def inplist():
	return list(map(int, input().split()))

def inpstrlist():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def printlist(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')
t = inp()
for _ in range(t):
	n = inp()
	arr = inplist()
	cnt = 6 * (n // 2)
	print(cnt)
	for i in range(1, n + 1, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)


I = input
for _ in range(int(I())):
	(n, __) = (int(I()), I())
	print(3 * n)
	for i in range(1, n + 1, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)


import sys, math, bisect
from random import randint
inf = float('inf')
mod = 10 ** 9 + 7

def lcm(a, b):
	return int(a / math.gcd(a, b) * b)

def gcd(a, b):
	return int(math.gcd(a, b))

def tobinary(n):
	return bin(n)[2:]

def binarySearch(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def lowerBound(a, x):
	i = bisect.bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def upperBound(a, x):
	i = bisect.bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def primesInRange(n):
	ans = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			ans.append(p)
	return ans

def primeFactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n = n // i
	if n > 2:
		factors.append(n)
	return factors

def isPrime(n, k=5):
	if n < 2:
		return True
	for i in range(0, k):
		a = randint(1, n - 1)
		if pow(a, n - 1, n) != 1:
			return False
	return True
from collections import deque, defaultdict, Counter
import heapq, string
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	a = 1
	b = 2
	print(n // 2 * 6)
	for _ in range(n // 2):
		print(2, a, b)
		print(2, a, b)
		print(1, a, b)
		print(2, a, b)
		print(2, a, b)
		print(1, a, b)
		a += 2
		b += 2


from sys import stdin, stdout
(input, print) = (stdin.readline, stdout.write)
from math import *

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		print(str(3 * n) + '\n')
		c = n // 2
		for i in range(1, c + 1):
			print('1 ' + str(i) + ' ' + str(i + c) + '\n')
			print('2 ' + str(i) + ' ' + str(i + c) + '\n')
			print('1 ' + str(i) + ' ' + str(i + c) + '\n')
			print('1 ' + str(i) + ' ' + str(i + c) + '\n')
			print('2 ' + str(i) + ' ' + str(i + c) + '\n')
			print('1 ' + str(i) + ' ' + str(i + c) + '\n')
main()


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	print(3 * n)
	for i in range(1, n + 1, 2):
		for _ in range(2):
			print(1, i, i + 1)
			print(2, i, i + 1)
			print(1, i, i + 1)


import os, sys, math
from io import BytesIO, IOBase
from collections import defaultdict, deque, OrderedDict
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')

def I():
	return int(input())

def In():
	return map(int, input().split())

def ln():
	return list(map(int, input().split()))

def Sn():
	return input().strip()
BUFSIZE = 8192

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return len(a)

def solve():
	n = I()
	l = list(In())
	ans = []
	for i in range(0, n, 2):
		ans.append((1, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
		ans.append((2, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
		ans.append((1, i + 1, i + 2))
		ans.append((2, i + 1, i + 2))
	print(len(ans))
	for x in ans:
		print(*x)
	pass

def main():
	T = I()
	for i in range(T):
		solve()
M = 998244353
P = 1000000007

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def lsi():
	return list(msi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
mod = 1000000007

def modInverse(b, m):
	g = gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def ceil2(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def modu(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		return -999999999
	else:
		return inv * a % m
from math import log, factorial, cos, tan, sin, radians, floor, sqrt, ceil, log2
import bisect
import random
import string
from decimal import *
getcontext().prec = 50
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def gcd1(a):
	if len(a) == 1:
		return a[0]
	ans = a[0]
	for i in range(1, len(a)):
		ans = gcd(ans, a[i])
	return ans

def mykey(x):
	return len(x)

def checkper_sq(n):

	def check(n, mod):
		for i in range(mod):
			if i * i % mod == n % mod:
				return True
		return False
	for i in range(3, 101):
		if not check(n, i):
			return False
	return True

def main():
	for _ in range(ii()):
		n = ii()
		a = li()
		ans = 6 * (n // 2)
		print(ans)
		for i in range(n // 2):
			j = 2 * i + 1
			print(1, j, j + 1)
			print(2, j, j + 1)
			print(1, j, j + 1)
			print(2, j, j + 1)
			print(1, j, j + 1)
			print(2, j, j + 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from collections import defaultdict

def main():
	for _ in range(int(input())):
		n = int(input())
		d = {}
		l = list(map(int, input().split()))
		count = 0
		for i in range(0, n, 2):
			(x, y) = (l[i], l[i + 1])
			x += y
			d[count] = [1, i + 1, i + 2]
			count += 1
			while not (x == -l[i] and y == -l[i + 1]):
				if y > -l[i + 1]:
					y -= x
					d[count] = [2, i + 1, i + 2]
					count += 1
				elif x > -l[i] and x + y >= -l[i]:
					x += y
					d[count] = [1, i + 1, i + 2]
					count += 1
				elif y < -l[i + 1]:
					y -= x
					d[count] = [2, i + 1, i + 2]
					count += 1
				else:
					x += y
					d[count] = [1, i + 1, i + 2]
					count += 1
		print(count)
		for i in range(count):
			print(' '.join(map(str, d[i])))

def SumOfExpOfFactors(a):
	fac = 0
	lis = SortedList()
	if not a & 1:
		lis.add(2)
	while not a & 1:
		a >>= 1
		fac += 1
	for i in range(3, int(a ** 0.5) + 1, 2):
		if not a % i:
			lis.add(i)
		while not a % i:
			a //= i
			fac += 1
	if a != 1:
		lis.add(a)
		fac += 1
	return (fac, lis)
div = [0] * 1000001

def NumOfDivisors(n):
	for i in range(1, n + 1):
		for j in range(i, n + 1, i):
			div[j] += 1

def primes1(n):
	sieve = [True] * (n // 2)
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i // 2]:
			sieve[i * i // 2::i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [2 * i + 1 for i in range(1, n // 2) if sieve[i]]

def GCD(a, b):
	if b == 0:
		return a
	else:
		return GCD(b, a % b)

class Graph:

	def __init__(self):
		self.Graph = defaultdict(list)

	def addEdge(self, u, v):
		self.Graph[u].append(v)
		self.Graph[v].append(u)

	def DFSUtil(self, v, visited):
		visited.add(v)
		for neighbour in self.Graph[v]:
			if neighbour not in visited:
				self.DFSUtil(neighbour, visited)

	def DFS(self, v):
		visited = set()
		self.DFSUtil(v, visited)

	def BFS(self, s):
		visited = set()
		queue = []
		queue.append(s)
		visited.add(s)
		while queue:
			s = queue.pop(0)
			for i in self.Graph[s]:
				if i not in visited:
					queue.append(i)
					visited.add(i)

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))
main()


MAX_ACTIONS = 5000

def op1(i1, i2):
	print(1, i1, i2)

def op2(i1, i2):
	print(2, i1, i2)

def op(i1, i2):
	op2(i1, i2)
	op1(i1, i2)
	op2(i1, i2)
	op2(i1, i2)
	op1(i1, i2)
	op2(i1, i2)

def solve():
	nr_var = int(input())
	a = list(map(int, input().split()))
	print(3 * nr_var)
	for i in range(0, nr_var, 2):
		op(i + 1, i + 2)
t = int(input())
for i in range(t):
	solve()


def fun(ls, n):
	print(3 * n)
	for i in range(0, n, 2):
		index = i + 1
		print(1, index, index + 1)
		print(2, index, index + 1)
		print(1, index, index + 1)
		print(1, index, index + 1)
		print(2, index, index + 1)
		print(1, index, index + 1)
T = int(input())
for _ in range(T):
	n = int(input())
	ls = list(map(int, input().split()))
	fun(ls, n)


t = int(input())
while t:
	t -= 1
	n = int(input())
	arr = [int(c) for c in input().split()]
	print(n * 3)
	for i in range(1, n + 1, 2):
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)


t = int(input())
while t:
	n = int(input())
	l = [int(i) for i in input().split()]
	print(6 * (n // 2))
	i = 0
	while i < n:
		print('2' + ' ' + str(i + 1) + ' ' + str(i + 2))
		print('1' + ' ' + str(i + 1) + ' ' + str(i + 2))
		print('2' + ' ' + str(i + 1) + ' ' + str(i + 2))
		print('1' + ' ' + str(i + 1) + ' ' + str(i + 2))
		print('2' + ' ' + str(i + 1) + ' ' + str(i + 2))
		print('1' + ' ' + str(i + 1) + ' ' + str(i + 2))
		i += 2
	t -= 1


t = int(input())
while t:
	t = t - 1
	n = int(input())
	arr = list(map(int, input().split()))
	print(n // 2 * 6)
	for i in range(0, n, 2):
		print(1, i + 1, i + 2)
	for i in range(0, n, 2):
		print(2, i + 1, i + 2)
	for i in range(0, n, 2):
		print(1, i + 1, i + 2)
	for i in range(0, n, 2):
		print(2, i + 1, i + 2)
	for i in range(0, n, 2):
		print(1, i + 1, i + 2)
	for i in range(0, n, 2):
		print(2, i + 1, i + 2)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	print(n * 3)
	for i in range(0, n, 2):
		print(2, 1 + i, 2 + i)
		print(1, 1 + i, 2 + i)
		print(1, 1 + i, 2 + i)
		print(2, 1 + i, 2 + i)
		print(1, 1 + i, 2 + i)
		print(1, 1 + i, 2 + i)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	w = list(map(int, input().split()))
	d = [1, 2, 2, 1, 2, 2]
	print(6 * n // 2)
	for i in range(n // 2):
		for j in range(6):
			print(d[j], i * 2 + 1, i * 2 + 2)


from sys import stdin, stdout
intn = lambda : int(stdin.readline())
strs = lambda : stdin.readline()[:-1]
lstr = lambda : list(stdin.readline()[:-1])
mint = lambda : map(int, stdin.readline().split())
lint = lambda : list(map(int, stdin.readline().split()))
out = lambda x: stdout.write(str(x) + '\n')
out_ = lambda x: stdout.write(str(x) + ' ')

def main():
	for _ in range(intn()):
		n = intn()
		a = lint()
		out(3 * n)
		for i in range(0, n, 2):
			for j in range(3):
				out(f'1 {i + 1} {i + 2}')
				out(f'2 {i + 1} {i + 2}')
main()


for tc in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	print(int(len(arr) / 2 * 6))
	for i in range(0, n, 2):
		j = i + 1
		for x in range(6):
			if x % 2 == 0:
				print('1', i + 1, j + 1)
			else:
				print('2', i + 1, j + 1)


import sys

def I():
	return int(sys.stdin.readline().rstrip())

def MI():
	return map(int, sys.stdin.readline().rstrip().split())

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def LI2():
	return list(map(int, sys.stdin.readline().rstrip()))

def S():
	return sys.stdin.readline().rstrip()

def LS():
	return list(sys.stdin.readline().rstrip().split())

def LS2():
	return list(sys.stdin.readline().rstrip())
t = I()
for _ in range(t):
	n = I()
	A = LI()
	print(3 * n)
	for i in range(n // 2):
		x = 2 * i + 1
		y = 2 * i + 2
		for a in [1, 2, 1, 1, 2, 1]:
			print(a, x, y)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	operations = []
	for i in range(0, n, 2):
		(a, b) = (arr[i], arr[i + 1])
		while arr[i] != -a or arr[i + 1] != -b:
			arr[i] += arr[i + 1]
			arr[i + 1] -= arr[i]
			operations.append('1 %d %d' % (i + 1, i + 2))
			operations.append('2 %d %d' % (i + 1, i + 2))
	k = len(operations)
	print(k)
	for i in range(k):
		print(operations[i])


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	print(n // 2 * 6)
	for i in range(0, n, 2):
		for p in range(3):
			print('1 {} {}'.format(i + 1, i + 2))
			print('2 {} {}'.format(i + 1, i + 2))


t = int(input())
INF = 1000500700
for _ in range(t):
	n = int(input())
	s = input()
	r = n // 2
	print(r * 6)
	for k in range(r):
		i = 2 * k + 1
		j = 2 * k + 2
		print(1, i, j)
		print(2, i, j)
		print(1, i, j)
		print(1, i, j)
		print(2, i, j)
		print(1, i, j)


from sys import stdin

def solve():
	n = int(stdin.readline().strip())
	_ = stdin.readline()
	print(n * 3)
	for i in range(0, n, 2):
		for _ in range(3):
			print(2, i + 1, i + 2)
			print(1, i + 1, i + 2)
t = int(stdin.readline().strip())
for _ in range(t):
	solve()


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	li = list(map(int, input().split()))
	print(3 * n)
	for i in range(1, n + 1, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)


T = int(input())
while T > 0:
	n = int(input())
	list1 = [int(x) for x in input().split()]
	print(3 * n)
	for i in range(0, n, 2):
		print(2, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
	T -= 1


import os
import sys
from io import BytesIO, IOBase
import math
from collections import Counter

def func(array):
	print(3 * len(array))
	for i in range(0, len(array), 2):
		for j in range(3):
			print(f'2 {i + 1} {i + 2}')
			print(f'1 {i + 1} {i + 2}')

def main():
	num_test = int(parse_input())
	result = []
	for _ in range(num_test):
		n = int(parse_input())
		array = [int(i) for i in parse_input().split()]
		func(array)
parse_input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l1 = []
	l2 = []
	l3 = []
	for i in range(0, n, 2):
		l1.append(1)
		l2.append(i + 1)
		l3.append(i + 2)
		l1.append(2)
		l2.append(i + 1)
		l3.append(i + 2)
		l1.append(2)
		l2.append(i + 1)
		l3.append(i + 2)
		l1.append(1)
		l2.append(i + 1)
		l3.append(i + 2)
		l1.append(2)
		l2.append(i + 1)
		l3.append(i + 2)
		l1.append(2)
		l2.append(i + 1)
		l3.append(i + 2)
	print(len(l1))
	for i in range(len(l1)):
		print(l1[i], l2[i], l3[i])


from sys import stdin, stdout
from math import ceil, floor, sqrt, log, log2, log10
from collections import Counter
int_max = float('inf')
int_min = -float('inf')
input = stdin.readline

def solve():
	pass
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(3 * n)
	for i in range(0, n, 2):
		for j in range(6):
			print(2 if not j % 2 else 1, i + 1, i + 2)


from collections import Counter, defaultdict, deque
import math
import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	s = [int(x) for x in input().split()]
	print(n * 3)
	for i in range(1, n + 1, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
tt = int(input())
for test in range(tt):
	solve()


cases = int(input())
for _ in range(cases):
	n = int(input())
	numbers = [int(number) for number in input().split()]
	print(n * 3)
	for i in range(0, n, 2):
		for k in range(6):
			print('%s %s %s' % (k % 2 + 1, i + 1, i + 2))


t = int(input())
for q in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	i = 0
	print(3 * n)
	while i < n - 1:
		a1 = a[i]
		a2 = a[i + 1]
		print('1', i + 1, i + 2)
		print('2', i + 1, i + 2)
		print('1', i + 1, i + 2)
		print('1', i + 1, i + 2)
		print('2', i + 1, i + 2)
		print('1', i + 1, i + 2)
		i += 2


q = int(input())
for i in range(q):
	w = int(input())
	e = input()
	print(w * 3)
	for j in range(w // 2):
		print(*[2, 2 * j + 1, 2 * j + 2], sep=' ')
		print(*[1, 2 * j + 1, 2 * j + 2], sep=' ')
		print(*[2, 2 * j + 1, 2 * j + 2], sep=' ')
		print(*[1, 2 * j + 1, 2 * j + 2], sep=' ')
		print(*[2, 2 * j + 1, 2 * j + 2], sep=' ')
		print(*[1, 2 * j + 1, 2 * j + 2], sep=' ')


def solve():
	n = int(input())
	arr = [int(x) for x in input().strip().split()]
	ops = []
	for i in range(0, n, 2):
		if arr[i] == arr[i + 1]:
			ops.extend([f'2 {i + 1} {i + 2}', f'2 {i + 1} {i + 2}', f'1 {i + 1} {i + 2}', f'1 {i + 1} {i + 2}'])
			arr[i + 1] -= arr[i]
			arr[i + 1] -= arr[i]
			arr[i] += arr[i + 1]
			arr[i] += arr[i + 1]
		else:
			ops.extend([f'2 {i + 1} {i + 2}', f'2 {i + 1} {i + 2}', f'1 {i + 1} {i + 2}', f'2 {i + 1} {i + 2}', f'2 {i + 1} {i + 2}', f'1 {i + 1} {i + 2}'])
			arr[i + 1] -= arr[i]
			arr[i + 1] -= arr[i]
			arr[i] += arr[i + 1]
			arr[i + 1] -= arr[i]
			arr[i + 1] -= arr[i]
			arr[i] += arr[i + 1]
	print(len(ops))
	for op in ops:
		print(op)
for _ in range(int(input().strip())):
	solve()


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = [int(ai) for ai in input().split()]
		print(n * 3)
		for i in range(0, n, 2):
			print(1, i + 1, i + 2)
			print(2, i + 1, i + 2)
			print(1, i + 1, i + 2)
			print(1, i + 1, i + 2)
			print(2, i + 1, i + 2)
			print(1, i + 1, i + 2)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin
from collections import defaultdict, deque, Counter
from math import floor, ceil, log, inf, sqrt
from heapq import *
from functools import lru_cache
import itertools
from bisect import bisect_left, bisect_right
T = int(stdin.readline())
for t in range(T):
	N = int(stdin.readline())
	nums = [int(x) for x in stdin.readline().split()]
	print(N // 2 * 6)
	for i in range(0, N, 2):
		print('1 {} {}'.format(i + 1, i + 2))
		print('2 {} {}'.format(i + 1, i + 2))
		print('1 {} {}'.format(i + 1, i + 2))
		print('1 {} {}'.format(i + 1, i + 2))
		print('2 {} {}'.format(i + 1, i + 2))
		print('1 {} {}'.format(i + 1, i + 2))


tcs = int(input())
for tc in range(tcs):
	n = int(input())
	L = list(map(int, input().split()))
	print(3 * n)
	for i in range(1, n + 1, 2):
		for j in [2, 1, 2, 1, 2, 1]:
			print(j, i, i + 1)


def solve(n, a):
	k = 3 * n
	print(k)
	i = 1
	while i <= n:
		print('2' + ' ' + str(i) + ' ' + str(i + 1))
		print('1' + ' ' + str(i) + ' ' + str(i + 1))
		print('1' + ' ' + str(i) + ' ' + str(i + 1))
		print('2' + ' ' + str(i) + ' ' + str(i + 1))
		print('1' + ' ' + str(i) + ' ' + str(i + 1))
		print('1' + ' ' + str(i) + ' ' + str(i + 1))
		i += 2
	return
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().strip().split()))[:n]
	solve(n, a)


import math
from collections import defaultdict
from heapq import heappush, heappop
DEBUG = True

def log(*args, **kwargs):
	if DEBUG:
		print(*args, **kwargs)

def ri():
	return int(input())

def rl(f=int):
	return list(map(f, input().split()))

def rs():
	return input()

class Solution:

	def __init__(self):
		pass

	def run(self):
		n = ri()
		a = rl()
		print(n * 3)
		for i in range(0, n - 1, 2):
			print(1, i + 1, i + 2)
			a[i] += a[i + 1]
			print(2, i + 1, i + 2)
			a[i + 1] -= a[i]
			print(1, i + 1, i + 2)
			a[i] += a[i + 1]
			print(2, i + 1, i + 2)
			a[i + 1] -= a[i]
			print(1, i + 1, i + 2)
			a[i] += a[i + 1]
			print(2, i + 1, i + 2)
			a[i + 1] -= a[i]
t = int(input())
s = Solution()
for i in range(t):
	s.run()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	input()
	print(6 * n // 2)
	for i in range(0, n, 2):
		print('2', i + 1, i + 2)
		print('2', i + 1, i + 2)
		print('1', i + 1, i + 2)
		print('2', i + 1, i + 2)
		print('2', i + 1, i + 2)
		print('1', i + 1, i + 2)


import sys, os
import math
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		n = int(input())
		arr = list(MI())
		print(3 * n)
		for i in range(n // 2):
			print(1, 2 * i + 1, 2 * i + 2)
			print(2, 2 * i + 1, 2 * i + 2)
			print(2, 2 * i + 1, 2 * i + 2)
			print(1, 2 * i + 1, 2 * i + 2)
			print(2, 2 * i + 1, 2 * i + 2)
			print(2, 2 * i + 1, 2 * i + 2)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def MI():
	return map(int, input().split())

def outP(var):
	sys.stdout.write(str(var) + '\n')
MOD = 10 ** 9 + 7
mod = 998244353
main()


import sys, math, heapq
from collections import defaultdict, deque
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	ans = []
	for i in range(n // 2):
		x = i + 1
		y = n - i
		ans.append([2, x, y])
		ans.append([1, x, y])
		ans.append([2, x, y])
		ans.append([2, x, y])
		ans.append([1, x, y])
		ans.append([2, x, y])
	print(len(ans))
	for v in ans:
		print(*v)


PI = 3.141592653589793
INF = 999999999
MOD = 1000000007

def add(x, y):
	return (x + y) % MOD

def sub(x, y):
	return (x - y + MOD) % MOD

def mul(x, y):
	return x * y % MOD

def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)

def lcm(x, y):
	return x * y // gcd(x, y)

def power(x, y):
	res = 1
	x %= MOD
	while y != 0:
		if y & 1:
			res = mul(res, x)
		y >>= 1
		x = mul(x, x)
	return res

def mod_inv(n):
	return power(n, MOD - 2)

def prob(p, q):
	return mul(p, power(q, MOD - 2))

def ii():
	return int(input())

def li():
	return [int(i) for i in input().split()]

def ls():
	return [i for i in input().split()]
for t in range(ii()):
	t += 1
	n = ii()
	a = li()
	print(3 * n)
	for j in range(0, n, 2):
		i = j + 1
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)


import sys

def ints():
	return list(map(int, sys.stdin.readline().strip().split()))
T = int(input())
while T:
	T -= 1
	n = int(input())
	ls = ints()
	print(6 * n // 2)
	for i in range(1, n, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	print(n // 2 * 6)
	for i in range(1, n, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)


def values(n, A):
	O = []
	for i in range(0, n, 2):
		j = i + 1
		O.extend(((1, i + 1, j + 1), (2, i + 1, j + 1), (1, i + 1, j + 1), (2, i + 1, j + 1), (1, i + 1, j + 1), (2, i + 1, j + 1)))
	return (len(O), O)

def main():
	t = readint()
	L = []
	for _ in range(t):
		n = readint()
		A = readinti()
		(m, O) = values(n, A)
		L.append(str(m))
		L.extend((f'{o[0]} {o[1]} {o[2]}' for o in O))
	print('\n'.join(L))
import sys

def readint():
	return int(input())

def readinti():
	return map(int, input().split())

def readintl():
	return list(readinti())

def readintll(k):
	return [readintl() for _ in range(k)]

def log(*args, **kwargs):
	print(*args, **kwargs, file=sys.stderr)
main()


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
from itertools import accumulate, permutations
import sys
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	n = val()
	l = li()
	ans = []
	for i in range(1, n, 2):
		ans.append([1, i, i + 1])
		ans.append([2, i, i + 1])
		ans.append([1, i, i + 1])
		ans.append([2, i, i + 1])
		ans.append([1, i, i + 1])
		ans.append([2, i, i + 1])
	print(len(ans))
	for (a, b, c) in ans:
		print(a, b, c)


from typing import List

def solve(n: int, a: List[int]) -> None:
	print(n * 3)
	for i in range(1, n, 2):
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
	return
test_cases = int(input())
for _ in range(test_cases):
	n = int(input())
	a = list(map(int, input().split()))
	solve(n, a)


import math
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
for _ in range(inp()):
	n = inp()
	l = inlt()
	print(3 * n)
	for i in range(0, n, 2):
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)


def solve(l, n):
	a = []
	b = []
	c = []
	for i in range(0, n, 2):
		a.append(1)
		b.append(i + 1)
		c.append(i + 2)
		a.append(2)
		b.append(i + 1)
		c.append(i + 2)
		a.append(2)
		b.append(i + 1)
		c.append(i + 2)
		a.append(1)
		b.append(i + 1)
		c.append(i + 2)
		a.append(2)
		b.append(i + 1)
		c.append(i + 2)
		a.append(2)
		b.append(i + 1)
		c.append(i + 2)
	print(len(a))
	for i in range(len(a)):
		print(a[i], b[i], c[i])
for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	solve(l, n)


import math, copy
from collections import defaultdict, Counter

def fact(n):
	return 1 if n == 1 or n == 0 else n * fact(n - 1)

def prime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def inp():
	l = list(map(int, input().split()))
	return l

def main():
	for _ in range(int(input())):
		n = int(input())
		l = inp()
		k = []
		for i in range(1, n + 1, 2):
			k.append([1, i, i + 1])
			k.append([2, i, i + 1])
			k.append([1, i, i + 1])
			k.append([1, i, i + 1])
			k.append([2, i, i + 1])
			k.append([1, i, i + 1])
		print(len(k))
		for i in k:
			print(*i)
import os, sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)


import sys
readline = sys.stdin.readline
DEBUG = True
T = int(input())
Ans = []
for qu in range(T):
	N = int(readline())
	A = list(map(int, readline().split()))
	cnt = 0
	res = []
	for i in range(1, N + 1, 2):
		j = i + 1
		res.append((1, i, j))
		res.append((2, i, j))
		res.append((1, i, j))
		res.append((1, i, j))
		res.append((2, i, j))
		res.append((1, i, j))
	Ans.append(str(len(res)))
	oA = A[:]
	for (a, b, c) in res:
		Ans.append('{} {} {}'.format(a, b, c))
		b -= 1
		c -= 1
		if a == 1:
			A[b] += A[c]
		else:
			A[c] -= A[b]
print('\n'.join(Ans))


import sys, os, io
import math, bisect, operator, itertools
(inf, mod) = (float('inf'), 10 ** 9 + 7)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
Neo = lambda : list(map(int, input().split()))
(test,) = Neo()
for _ in range(test):
	(n,) = Neo()
	A = Neo()
	i = 1
	print(3 * n)
	while i < n:
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		i += 2


def shu(i):
	print('{} {} {}'.format(1, i, i + 1))
	print('{} {} {}'.format(2, i, i + 1))
	print('{} {} {}'.format(1, i, i + 1))
	print('{} {} {}'.format(1, i, i + 1))
	print('{} {} {}'.format(2, i, i + 1))
	print('{} {} {}'.format(1, i, i + 1))
t = eval(input())
for r in range(t):
	n = eval(input())
	a = input().split(' ')
	a = [eval(x) for x in a]
	i = 0
	print(n * 3)
	while i <= n - 2:
		shu(i + 1)
		i += 2


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(6 * (n // 2))
	for i in range(n // 2):
		j = i + n // 2
		l[j] = l[j] - l[i]
		print('2', i + 1, j + 1)
		l[i] = l[i] + l[j]
		print('1', i + 1, j + 1)
		l[j] = l[j] - l[i]
		print('2', i + 1, j + 1)
		l[j] = l[j] - l[i]
		print('2', i + 1, j + 1)
		l[i] = l[i] + l[j]
		print('1', i + 1, j + 1)
		l[j] = l[j] - l[i]
		print('2', i + 1, j + 1)


from math import *
from collections import defaultdict as dt
from sys import stdin
inp = lambda : stdin.readline().strip()
I = lambda : int(inp())
M = lambda : map(int, inp().split())
L = lambda : list(M())
mod = 1000000007
inf = 100000000000000000000
ss = 'abcdefghijklmnopqrstuvwxyz'

def solve():
	n = I()
	a = L()
	print(n * 3)
	for i in range(1, n, 2):
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
		print(1, i, i + 1)
		print(2, i, i + 1)
		print(2, i, i + 1)
tt = 1
tt = I()
for _ in range(tt):
	solve()


for I in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(3 * n)
	for I in range(0, n, 2):
		I += 1
		z = lambda a: print(a, I, I + 1)
		z(2)
		z(1)
		z(2)
		z(2)
		z(1)
		z(2)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	i = 0
	print(n // 2 * 6)
	while i < n:
		for j in range(3):
			print(2, i + 1, i + 2)
			print(1, i + 1, i + 2)
		i += 2


a = int(input())
for x in range(0, a):
	t = int(input())
	n = map(int, input().split())
	print(t * 3)
	for i in range(0, t, 2):
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(1, i + 1, i + 2)
		print(2, i + 1, i + 2)
		print(1, i + 1, i + 2)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect, insort
from time import perf_counter
from fractions import Fraction
import copy
from copy import deepcopy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(*ele, end='\n')
for _ in range(L()[0]):
	n = L()[0]
	A = L()
	ops = []
	for i in range(0, n, 2):
		ops.append([1, i + 1, i + 2])
		ops.append([2, i + 1, i + 2])
		ops.append([1, i + 1, i + 2])
		ops.append([2, i + 1, i + 2])
		ops.append([1, i + 1, i + 2])
		ops.append([2, i + 1, i + 2])
	print(len(ops))
	pmat(ops)
endtime = time.time()


def one(i, j, a, b):
	a = a + b
	return (a, b)

def two(i, j, a, b):
	b = b - a
	return (a, b)

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		print(n // 2 * 6)
		for i in range(1, n + 1, 2):
			j = i + 1
			print(1, i, j)
			print(2, i, j)
			print(1, i, j)
			print(1, i, j)
			print(2, i, j)
			print(1, i, j)
main()


import sys

def answer(n, a):
	num_steps = 0
	ans = []
	for i in range(0, n, 2):
		n1 = a[i]
		n2 = a[i + 1]
		if n1 == n2:
			num_steps += 4
			ans.append((2, i, i + 1))
			ans.append((2, i, i + 1))
			ans.append((1, i, i + 1))
			ans.append((1, i, i + 1))
		elif n1 != n2:
			num_steps += 6
			ans.append((1, i, i + 1))
			ans.append((2, i, i + 1))
			ans.append((1, i, i + 1))
			ans.append((2, i, i + 1))
			ans.append((1, i, i + 1))
			ans.append((2, i, i + 1))
	print(num_steps)
	for tup in ans:
		print(tup[0], tup[1] + 1, tup[2] + 1)
	return

def main():
	t = int(sys.stdin.readline())
	while t:
		n = int(sys.stdin.readline())
		a = list(map(int, sys.stdin.readline().split()))
		answer(n, a)
		t -= 1
	return
main()