Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a friend Zahar who works at a career. Zahar knows about Kostya's idea and wants to present him a rectangular parallelepiped of marble from which he can carve the sphere. 

Zahar has n stones which are rectangular parallelepipeds. The edges sizes of the i-th of them are a_{i}, b_{i} and c_{i}. He can take no more than two stones and present them to Kostya. 

If Zahar takes two stones, he should glue them together on one of the faces in order to get a new piece of rectangular parallelepiped of marble. Thus, it is possible to glue a pair of stones together if and only if two faces on which they are glued together match as rectangles. In such gluing it is allowed to rotate and flip the stones in any way. 

Help Zahar choose such a present so that Kostya can carve a sphere of the maximum possible volume and present it to Zahar.


-----Input-----

The first line contains the integer n (1 ≤ n ≤ 10^5).

n lines follow, in the i-th of which there are three integers a_{i}, b_{i} and c_{i} (1 ≤ a_{i}, b_{i}, c_{i} ≤ 10^9) — the lengths of edges of the i-th stone. Note, that two stones may have exactly the same sizes, but they still will be considered two different stones.


-----Output-----

In the first line print k (1 ≤ k ≤ 2) the number of stones which Zahar has chosen. In the second line print k distinct integers from 1 to n — the numbers of stones which Zahar needs to choose. Consider that stones are numbered from 1 to n in the order as they are given in the input data.

You can print the stones in arbitrary order. If there are several answers print any of them. 


-----Examples-----
Input
6
5 5 5
3 2 4
1 4 1
2 1 3
3 2 4
3 3 4

Output
1
1

Input
7
10 7 8
5 10 3
4 2 6
5 5 5
10 2 8
4 2 1
7 7 7

Output
2
1 5



-----Note-----

In the first example we can connect the pairs of stones:  2 and 4, the size of the parallelepiped: 3 × 2 × 5, the radius of the inscribed sphere 1  2 and 5, the size of the parallelepiped: 3 × 2 × 8 or 6 × 2 × 4 or 3 × 4 × 4, the radius of the inscribed sphere 1, or 1, or 1.5 respectively.  2 and 6, the size of the parallelepiped: 3 × 5 × 4, the radius of the inscribed sphere 1.5  4 and 5, the size of the parallelepiped: 3 × 2 × 5, the radius of the inscribed sphere 1  5 and 6, the size of the parallelepiped: 3 × 4 × 5, the radius of the inscribed sphere 1.5 

Or take only one stone:  1 the size of the parallelepiped: 5 × 5 × 5, the radius of the inscribed sphere 2.5  2 the size of the parallelepiped: 3 × 2 × 4, the radius of the inscribed sphere 1  3 the size of the parallelepiped: 1 × 4 × 1, the radius of the inscribed sphere 0.5  4 the size of the parallelepiped: 2 × 1 × 3, the radius of the inscribed sphere 0.5  5 the size of the parallelepiped: 3 × 2 × 4, the radius of the inscribed sphere 1  6 the size of the parallelepiped: 3 × 3 × 4, the radius of the inscribed sphere 1.5 

It is most profitable to take only the first stone.

Difficulty: MEDIUM_HARD
Tags: String algorithms

Data structures
Skill types: Data structures

Starter code:

Solutions:
from itertools import combinations

def sides_pairs(box):
	return set((tuple(sorted(side)) for side in combinations(box.dimensions, 2)))

def two_integer_tuple_hash(t, hash_mul):
	value = 3430008
	for item in t:
		value = value * hash_mul ^ item
	return value

class Box:

	def __init__(self, dimensions, ind):
		self.dimensions = dimensions
		self.ind = ind

class HashTable:

	def __init__(self, hash_function, hash_mul=None):
		self.hash_function = hash_function
		self.table = [None] * 2 ** 20
		self.keys_set = set()
		if not hash_mul:
			self.hash_mul = 1000003
		else:
			self.hash_mul = hash_mul

	def __getitem__(self, key):
		try:
			key_hash = self.hash_function(key, self.hash_mul)
		except:
			raise KeyError(key)
		ind = key_hash & len(self.table) - 1
		if self.table[ind]:
			for item in self.table[ind]:
				if item[0] == key:
					return item[1]
		raise KeyError(key)

	def __setitem__(self, key, value):
		try:
			key_hash = self.hash_function(key, self.hash_mul)
		except:
			raise KeyError(key)
		ind = key_hash & len(self.table) - 1
		if not self.table[ind]:
			self.table[ind] = []
			self.table[ind].append((key, value))
			self.keys_set.add(key)
		else:
			replaced = False
			for (i, item) in enumerate(self.table[ind]):
				if item[0] == key:
					self.table[ind][i] = (key, value)
					replaced = True
					break
			if not replaced:
				self.table[ind].append((key, value))
				self.keys_set.add(key)

	def __repr__(self):
		items = []
		for item_list in self.table:
			if not item_list:
				continue
			for item in item_list:
				items.append(item)
		items_repr = [list(map(repr, item)) for item in items]
		return '{{{}}}'.format(', '.join(map(lambda item: '{}: {}'.format(*item), items_repr)))

	def keys(self):
		return self.keys_set

class HashSolver:

	def __init__(self):
		self.table = HashTable(two_integer_tuple_hash)
		self.best_boxes = []
		self.diam = 0

	def insert(self, box):
		box_diam = min(box.dimensions)
		if box_diam > self.diam:
			self.diam = box_diam
			self.best_boxes = [box.ind]
		surfaces = sides_pairs(box)
		for surface_sides in surfaces:
			if self.diam > min(surface_sides):
				continue
			third_side = box.dimensions[:]
			for side in surface_sides:
				third_side.remove(side)
			third_side = third_side[0]
			if surface_sides not in self.table.keys():
				self.table[surface_sides] = (box, third_side)
				continue
			(hashed_box, hashed_side) = self.table[surface_sides]
			stacking_diam = min([third_side + hashed_side] + list(surface_sides))
			if stacking_diam > self.diam:
				self.diam = stacking_diam
				self.best_boxes = [box.ind, hashed_box.ind]
			if third_side > hashed_side:
				self.table[surface_sides] = (box, third_side)
hash_table = HashSolver()
n_boxes = int(input())
for box_num in range(1, n_boxes + 1):
	box = Box(list(map(int, input().split())), box_num)
	hash_table.insert(box)
print(len(hash_table.best_boxes))
print(' '.join(map(str, sorted(hash_table.best_boxes))))


from collections import defaultdict
d = defaultdict(set)
(s, k) = (0, [])
for i in range(int(input())):
	(x, y, z) = sorted(map(int, input().split()))
	for (a, b, c) in [(x, y, z), (x, z, y), (y, z, x)]:
		d[a, b].add((c, i))
	q = min(x, y, z)
	if q > s:
		(s, k) = (q, (0, i))
for ((a, b), t) in d.items():
	if len(t) < 2:
		continue
	((x, i), (y, j)) = sorted(t)[-2:]
	q = min(a, x + y)
	if s < q:
		(s, k) = (q, (1, i, j))
for i in k:
	print(i + 1)


def define_nearest_primes(n):
	primes = [3, 7, 11, 17, 19, 23, 29, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 196613, 393241, 786433, 1572869]
	for i in range(0, len(primes)):
		if primes[i] > 1.5 * n:
			p = primes[i]
			break
	return p

def sort_box(box):
	if box[0] > box[1]:
		if box[0] > box[2]:
			if box[1] > box[2]:
				box = [box[2], box[1], box[0]]
			else:
				box = [box[1], box[2], box[0]]
		else:
			box = [box[1], box[0], box[2]]
	elif box[0] < box[2]:
		if box[1] < box[2]:
			box = [box[0], box[1], box[2]]
		else:
			box = [box[0], box[2], box[1]]
	else:
		box = [box[2], box[0], box[1]]
	return box

def hash_func(box, i, hash_table, biggest_merged_rectangular, p):
	index = (50033 * box[2] + box[1]) % p
	while len(hash_table[index]) > 0 and (box[1] != hash_table[index][0][2] or box[2] != hash_table[index][0][3]):
		index = (index + 1) % p
	if len(hash_table[index]) == 2:
		if box[0] > hash_table[index][0][1]:
			if hash_table[index][0][1] < hash_table[index][1][1]:
				hash_table[index][0] = [i, box[0], box[1], box[2]]
			else:
				hash_table[index][1] = [i, box[0], box[1], box[2]]
		elif box[0] > hash_table[index][1][1]:
			hash_table[index][1] = [i, box[0], box[1], box[2]]
		temp_box = [hash_table[index][0][2], hash_table[index][0][3], hash_table[index][0][1] + hash_table[index][1][1]]
		temp_box = sort_box(temp_box)
		if biggest_merged_rectangular[2] < temp_box[0]:
			biggest_merged_rectangular = [hash_table[index][0][0], hash_table[index][1][0], temp_box[0]]
	elif len(hash_table[index]) == 1:
		hash_table[index].append([i, box[0], box[1], box[2]])
		temp_box = [hash_table[index][0][2], hash_table[index][0][3], hash_table[index][0][1] + hash_table[index][1][1]]
		temp_box = sort_box(temp_box)
		if biggest_merged_rectangular[2] < temp_box[0]:
			biggest_merged_rectangular = [hash_table[index][0][0], hash_table[index][1][0], temp_box[0]]
	else:
		hash_table[index].append([i, box[0], box[1], box[2]])
	return (hash_table, biggest_merged_rectangular)

def print_result(biggest_rectangular, biggest_merged_rectangular):
	if biggest_rectangular[1] > biggest_merged_rectangular[2]:
		print('1' + '\n' + str(biggest_rectangular[0]))
	elif biggest_merged_rectangular[0] < biggest_merged_rectangular[1]:
		print('2' + '\n' + str(biggest_merged_rectangular[0]) + ' ' + str(biggest_merged_rectangular[1]))
	else:
		print('2' + '\n' + str(biggest_merged_rectangular[1]) + ' ' + str(biggest_merged_rectangular[0]))

def main():
	n = int(input())
	p = define_nearest_primes(n)
	hash_table = [[] for i in range(0, p)]
	biggest_rectangular = [0, 0]
	biggest_merged_rectangular = [0, 0, 0]
	for i in range(1, n + 1):
		box = input().split(' ')
		box = [int(box[0]), int(box[1]), int(box[2])]
		if box[1] == box[0] and box[0] == box[2]:
			if biggest_rectangular[1] < box[0]:
				biggest_rectangular[0] = i
				biggest_rectangular[1] = box[0]
		else:
			box = sort_box(box)
			if biggest_rectangular[1] < box[0]:
				biggest_rectangular[0] = i
				biggest_rectangular[1] = box[0]
			hashing = hash_func(box, i, hash_table, biggest_merged_rectangular, p)
			hash_table = hashing[0]
			biggest_merged_rectangular = hashing[1]
	print_result(biggest_rectangular, biggest_merged_rectangular)
main()


class HashMap(object):

	def __init__(self, size=256):
		self._keys = []
		self.data = [[0] for i in range(size)]
		self.numItems = 0
		self.size = size

	def __setitem__(self, key, value):
		pos = self.set_find(key)
		if pos != -1:
			if len(self.data[pos]) > 1:
				if self.data[pos][0] == key:
					try:
						self.data[pos] = [key, value]
					except:
						print('Update failed!')
						return False
					return True
			self.data[pos] = [key, value]
			self.numItems += 1
			self._keys.append(key)
			return True
		else:
			return False

	def __missing__(self, not_key):
		raise KeyError('{0} is not a valid key'.format(not_key))

	def __getitem__(self, key):
		pos = self.get_find(key)
		if pos == -1:
			return None
		else:
			return self.data[pos][1]

	def __repr__(self):
		return str(self.data)
		return 'HashMap({0})'.format(list_repr)

	def __contains__(self, key):
		if key in self._keys:
			return True
		else:
			return False

	def __len__(self):
		return len(self._keys)

	def __iter__(self):
		return (key for key in self._keys)

	def hashfunc(self, key):
		print(hash(key))
		return hash(key) % len(self._values)

	def set_find(self, key):
		collisionNum = 0
		currentPos = hash(key) % self.size
		while self.data[currentPos][0] != 0 and self.data[currentPos][0] != key:
			collisionNum += 1
			currentPos = (currentPos + collisionNum ** 2) % self.size
			if collisionNum > self.size:
				return -1
		return currentPos

	def get_find(self, key):
		collisionNum = 0
		currentPos = hash(key) % self.size
		while True:
			while self.data[currentPos][0] != 0 and self.data[currentPos][0] != key:
				collisionNum += 1
				currentPos = (currentPos + collisionNum ** 2) % self.size
				if collisionNum > self.size:
					return -1
			if self.data[currentPos][0] == 0:
				if len(self.data[currentPos]) == 1:
					return -1
				else:
					collisionNum += 1
					currentPos = (currentPos + collisionNum ** 2) % self.size
			else:
				return currentPos
answer = 0
min_val = 0
diam = 0
n = int(input())
shapes = {}
for i in range(n):
	face = list(sorted(map(int, input().split())))
	key = (face[1], face[2])
	if key in shapes:
		(old, k) = shapes[key]
		res = [old + face[0], face[1], face[2]]
		m = min(res)
		if m > min_val:
			min_val = m
			diam = m
			mn = [k, i]
		if old < face[0]:
			shapes[key] = (face[0], i)
	else:
		shapes[key] = (face[0], i)
	m = face[0]
	if m > min_val:
		diam = min(face)
		min_val = m
		mn = [i]
print(len(mn))
print(' '.join(map(lambda x: str(x + 1), mn)))


def max_radius(a, b, c):
	return min(a, b, c) / 2

def max_sum_radius(a, b, c, a2, b2, c2):
	sorted_first = sorted([a, b, c])
	sorted_second = sorted([a2, b2, c2])
	if sorted_first[1] == sorted_second[1] and sorted_first[2] == sorted_second[2]:
		return max_radius(sorted_first[0] + sorted_second[0], sorted_first[1], sorted_first[2])
	else:
		return 0
n = int(input())
a_arr = []
b_arr = []
c_arr = []
for i in range(n):
	(a, b, c) = (int(ch_num) for ch_num in input().split(' '))
	a_arr.append([a, b, c])
max_r = 0
for i in range(n):
	m_rad = max_radius(a_arr[i][0], a_arr[i][1], a_arr[i][2])
	if m_rad > max_r:
		max_r = m_rad
		answer = '1' + '\n' + str(i + 1)
my_dict = {}
for i in range(n):
	sorted_a_arr = sorted(a_arr[i])
	S = (sorted_a_arr[1], sorted_a_arr[2])
	if S not in my_dict:
		my_dict[S] = (sorted_a_arr[0], i)
	else:
		ind = my_dict[S][1]
		if my_dict[S][0] < sorted_a_arr[0]:
			my_dict[S] = (sorted_a_arr[0], i)
		summ = max_sum_radius(a_arr[i][0], a_arr[i][1], a_arr[i][2], a_arr[ind][0], a_arr[ind][1], a_arr[ind][2])
		if summ > max_r:
			max_r = summ
			answer = '2' + '\n' + str(i + 1) + ' ' + str(ind + 1)
print(answer)


hash_table = {}
n = int(input())
max_diam = 0
ordinal_numbers = []
for i in range(1, n + 1):
	seq = sorted(list(map(int, input().split())), reverse=True) + [i]
	face = (seq[0], seq[1])
	if face in hash_table:
		best = hash_table[face]
		new_seq = [seq[0], seq[1], seq[2] + best[2]]
		diam = min(new_seq)
		if diam > max_diam:
			ordinal_numbers = [best[-1], i]
			max_diam = diam
		if best[2] < seq[2]:
			hash_table[face] = seq
	else:
		if seq[2] > max_diam:
			ordinal_numbers = [i]
			max_diam = seq[2]
		hash_table[face] = seq
print(len(ordinal_numbers))
print(' '.join(map(str, ordinal_numbers)), end='')


def kostya_the_sculptor():
	no_blocks = int(input())
	min_value = 0
	solution = []
	d = {}
	for i in range(no_blocks):
		block = sorted([int(x) for x in input().strip().split(' ')])
		key = (block[1], block[2])
		if key in d:
			(old_value, othr) = d[key]
			result = [old_value + block[0], block[1], block[2]]
			if min(result) > min_value:
				min_value = min(result)
				solution = [othr, i + 1]
			if old_value < block[0]:
				d[key] = (block[0], i + 1)
		else:
			d[key] = (block[0], i + 1)
		if block[0] > min_value:
			min_value = block[0]
			solution = [i + 1]
	print(len(solution))
	print(' '.join((str(x) for x in solution)))
kostya_the_sculptor()


import sys
n = int(input())
parallels = []
glue = {}
max_min = 0
max_indexes = None
for i in range(n):
	(a, b, c) = [int(j) for j in input().split()]
	parallels.append((a, b, c))
	tmp_glue = {}
	tmp_glue[a, b] = c
	tmp_glue[b, a] = c
	tmp_glue[b, c] = a
	tmp_glue[c, b] = a
	tmp_glue[a, c] = b
	tmp_glue[c, a] = b
	for (k, v) in tmp_glue.items():
		if k in glue.keys():
			glue_k = glue[k]
			if len(glue_k) == 2:
				(min_v, min_i) = min(glue_k)
				if min_v < v:
					(max_v, max_i) = max(glue_k)
					glue[k] = [(max_v, max_i), (v, i + 1)]
					edge_min = min(min(k), max_v + v)
					if edge_min > max_min:
						max_min = edge_min
						max_indexes = [max_i, i + 1]
			else:
				(max_v, max_i) = glue[k][0]
				glue[k].append((v, i + 1))
				edge_min = min(min(k), max_v + v)
				if edge_min > max_min:
					max_min = edge_min
					max_indexes = [max_i, i + 1]
		else:
			glue[k] = [(v, i + 1)]
			edge_min = min(min(k), v)
			if edge_min > max_min:
				max_min = edge_min
				max_indexes = [i + 1]
print(len(max_indexes))
print(' '.join([str(idx) for idx in max_indexes]))


(d, d1) = ({}, {})
n = int(input())
for i in range(n):
	a = list(map(int, input().split()))
	a.sort()
	d1[a[0], a[1], a[2]] = i + 1
	if (a[0], a[1]) not in d.keys():
		d[a[0], a[1]] = [(a[2], i + 1)]
	elif len(d[a[0], a[1]]) == 1:
		d[a[0], a[1]] += [(a[2], i + 1)]
	else:
		d[a[0], a[1]] += [(a[2], i + 1)]
		d[a[0], a[1]].sort()
		d[a[0], a[1]] = d[a[0], a[1]][1:]
	if not (a[1] == a[0] and a[2] == a[1]):
		if (a[1], a[2]) not in d.keys():
			d[a[1], a[2]] = [(a[0], i + 1)]
		elif len(d[a[1], a[2]]) == 1:
			d[a[1], a[2]] += [(a[0], i + 1)]
		else:
			d[a[1], a[2]] += [(a[0], i + 1)]
			d[a[1], a[2]].sort()
			d[a[1], a[2]] = d[a[1], a[2]][1:]
	if not a[1] == a[2] and (not a[0] == a[1]):
		if (a[0], a[2]) not in d.keys():
			d[a[0], a[2]] = [(a[1], i + 1)]
		elif len(d[a[0], a[2]]) == 1:
			d[a[0], a[2]] += [(a[1], i + 1)]
		else:
			d[a[0], a[2]] += [(a[1], i + 1)]
			d[a[0], a[2]].sort()
			d[a[0], a[2]] = d[a[0], a[2]][1:]
r = 0
ans = []
for item in d.keys():
	if len(d[item]) == 1:
		w = [item[0], item[1], d[item][0][0]]
		w.sort()
		if w[0] > r:
			r = w[0]
			ans = [d[item][0][1]]
	else:
		w = [item[0], item[1], d[item][0][0]]
		w1 = [item[0], item[1], d[item][1][0]]
		R = min(item[0], item[1], w[2] + w1[2])
		w.sort()
		w1.sort()
		if R > r:
			r = R
			ans = [d[item][0][1], d[item][1][1]]
print(len(ans))
print(' '.join(map(str, ans)))


from collections import defaultdict
n = int(input())
glue = defaultdict(list)
max_c = (0, -1)
for i in range(n):
	(a, b, c) = sorted(map(int, input().split(' ')), reverse=True)
	if c > max_c[0]:
		max_c = (c, i)
	glue[a, b].append((c, i))
best = (1, max_c[0], max_c[1])
for ((a, b), c_list) in glue.items():
	if len(c_list) > 1:
		tmp = sorted(c_list)
		((c1, i1), (c2, i2)) = (tmp[-1], tmp[-2])
		mn = min(c1 + c2, a, b)
		if mn > best[1]:
			best = (2, mn, i1, i2)
if best[0] == 1:
	print(1)
	print(best[2] + 1)
else:
	print(2)
	print('{} {}'.format(best[2] + 1, best[3] + 1))


def hash_values(values):
	return '.'.join([str(i) for i in values])

def unique_pairs_hashes(values):
	if len(values) == 1:
		return [hash_values([values[0], values[0]])]
	elif len(values) == 2:
		return [hash_values(values)]
	else:
		return [hash_values(pair) for pair in [[values[0], values[1]], [values[1], values[2]], [values[0], values[2]]]]

def main():
	n = int(input())
	max_diameter = -1
	max_index = []
	boxes = dict()
	for i in range(n):
		box = sorted([int(item) for item in input().split()], reverse=True)
		hash_values = set(unique_pairs_hashes(box))
		diameter = min(box)
		if diameter > max_diameter:
			max_diameter = diameter
			max_index = [i]
		for hash_value in hash_values:
			if hash_value in boxes.keys():
				new_diameter = min([boxes[hash_value][0] + diameter] + [int(j) for j in hash_value.split('.')])
				if new_diameter > max_diameter:
					max_diameter = new_diameter
					max_index = [boxes[hash_value][1], i]
				if boxes[hash_value][0] < diameter:
					boxes[hash_value] = (diameter, i)
			else:
				boxes[hash_value] = (diameter, i)
	print(len(max_index))
	print(' '.join([str(i + 1) for i in max_index]))
main()


import sys
from itertools import combinations
r = sys.stdin.readline
N = int(r())
edge = dict()
ans = set()
mx = (0, 0)

def get_xy_z(xyz: list):
	res = []
	for i in range(3):
		lst = []
		tmp = 0
		for j in range(3):
			if i == j:
				tmp = xyz[j]
			else:
				lst.append(xyz[j])
		lst.sort()
		res.append((tuple(lst), tmp))
		res = list(set(res))
	return res
for i in range(1, N + 1):
	xyz = list(map(int, r().split()))
	ans.add((min(xyz), i))
	xy_z = get_xy_z(xyz)
	for (pair, z) in xy_z:
		if pair not in edge:
			edge[pair] = (z, i)
		else:
			(c, idx) = edge[pair]
			edge[pair] = (c, idx) if c > z else (z, i)
			lst = list(pair) + [c + z]
			if min(lst) > mx[0]:
				tmp = max(mx[0], min(lst))
				mx = (tmp, (idx, i))
ans = list(ans)
ans.sort(key=lambda x: x[0], reverse=True)
if ans[0][0] > mx[0]:
	print(1)
	print(ans[0][1])
else:
	print(2)
	print(*mx[1])


from collections import defaultdict
import os
import sys
from io import BytesIO, IOBase
ii = lambda : int(input())
lmii = lambda : list(map(int, input().split()))
slmii = lambda : sorted(map(int, input().split()))
li = lambda : list(input())
mii = lambda : map(int, input().split())
msi = lambda : map(str, input().split())

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

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

def main():
	n = ii()
	df = defaultdict(list)
	ds = defaultdict(list)
	dt = defaultdict(list)
	ind = defaultdict(list)
	for i in range(n):
		(a, b, c) = sorted(mii())
		ind[a, b, c].append(i + 1)
		df[a, b].append(c)
		ds[b, c].append(a)
		dt[a, c].append(b)
	vol = 0
	f = 1
	ci = -1
	ff = -1
	ss = -1
	for i in df:
		df[i].sort(reverse=True)
		if len(df[i]) == 1:
			if min(i[0], i[1], df[i][0]) >= vol:
				vol = min(i[0], i[1], df[i][0])
				f = 1
				ci = ind[i[0], i[1], df[i][0]][-1]
		elif min(i[0], i[1], df[i][-1] + df[i][-2]) >= vol:
			vol = min(i[0], i[1], df[i][-1] + df[i][-2])
			f = 2
			ff = ind[i[0], i[1], df[i][-1]][-1]
			ss = ind[i[0], i[1], df[i][-2]][-1]
			if ff == ss:
				ff = ind[i[0], i[1], df[i][-1]][-1]
				ss = ind[i[0], i[1], df[i][-2]][-2]
	for i in ds:
		ds[i].sort()
		if len(ds[i]) == 1:
			if min(i[0], i[1], ds[i][0]) >= vol:
				vol = min(i[0], i[1], ds[i][0])
				f = 1
				ci = ind[ds[i][0], i[0], i[1]][-1]
		elif min(i[0], i[1], ds[i][-1] + ds[i][-2]) >= vol:
			vol = min(i[0], i[1], ds[i][-1] + ds[i][-2])
			f = 2
			ff = ind[ds[i][-1], i[0], i[1]][-1]
			ss = ind[ds[i][-2], i[0], i[1]][-1]
			if ff == ss:
				ff = ind[ds[i][-1], i[0], i[1]][-1]
				ss = ind[ds[i][-2], i[0], i[1]][-2]
	for i in dt:
		dt[i].sort()
		if len(dt[i]) == 1:
			if min(i[0], i[1], dt[i][0]) >= vol:
				vol = min(i[0], i[1], dt[i][0])
				f = 1
				ci = ind[i[0], dt[i][0], i[1]][-1]
		elif min(i[0], i[1], dt[i][-1] + dt[i][-2]) >= vol:
			vol = min(i[0], i[1], dt[i][-1] + dt[i][-2])
			f = 2
			ff = ind[i[0], dt[i][-1], i[1]][-1]
			ss = ind[i[0], dt[i][-2], i[1]][-1]
			if ff == ss:
				ff = ind[i[0], dt[i][-1], i[1]][-1]
				ss = ind[i[0], dt[i][-2], i[1]][-2]
	print(f)
	if f == 2:
		print(ff, ss)
	else:
		print(ci)
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()


n = int(input())
d_max = 0
repo = {}

def update(a, b, c):
	global ans1, ans2, d_max, repo, i
	if (a, b) in repo:
		(seqNo, d) = repo[a, b]
		new_d = min(a, b, d + c)
		if new_d > d_max:
			d_max = new_d
			ans1 = 2
			ans2 = (seqNo, i + 1)
		if c > d:
			repo[a, b] = (i + 1, c)
	else:
		repo[a, b] = (i + 1, c)
for i in range(n):
	vals = input().split()
	(a, b, c) = (int(vals[0]), int(vals[1]), int(vals[2]))
	small = min(a, b, c)
	large = max(a, b, c)
	medium = a + b + c - small - large
	if small > d_max:
		d_max = small
		ans1 = 1
		ans2 = i + 1
	update(small, medium, large)
	update(small, large, medium)
	update(medium, large, small)
print(ans1)
if ans1 == 1:
	print(ans2)
else:
	print(*ans2)


n = int(input())
d = dict()
mx = 0
for i in range(n):
	par = sorted([int(i) for i in input().split()])
	if par[0] > mx:
		mx = par[0]
		result = [i + 1]
	key = str(par[1]) + ' ' + str(par[2])
	if key in d:
		s = d[key][0] + par[0]
		if s > mx:
			if s < par[1]:
				mx = d[key][0] + par[0]
				result = [d[key][1], i + 1]
			elif par[1] > mx:
				mx = par[1]
				result = [d[key][1], i + 1]
		if par[0] > d[key][0]:
			d[key] = (par[0], i + 1)
	else:
		d[key] = (par[0], i + 1)
print(len(result))
[print(i, end=' ') for i in result]


n = int(input())
our = []
d = dict()
res = 0
ans = ()
for i in range(n):
	(a, b, c) = sorted(list(map(int, input().split())))
	our.append((a, b, c))
	if (a, b) not in d:
		d[a, b] = []
	if (a, c) not in d:
		d[a, c] = []
	if (b, c) not in d:
		d[b, c] = []
	d[a, b].append([c, i])
	d[a, c].append([b, i])
	d[b, c].append([a, i])
	if res < min(a, b, c):
		res = min(a, b, c)
		ans = (i + 1,)
for (a, b) in d:
	if len(d[a, b]) >= 2:
		d[a, b].sort(reverse=True)
		if res < min(a, b, d[a, b][0][0] + d[a, b][1][0]):
			res = min(a, b, d[a, b][0][0] + d[a, b][1][0])
			ans = (d[a, b][0][1] + 1, d[a, b][1][1] + 1)
print(len(ans))
for elem in ans:
	print(elem, end=' ')


n = int(input())
a = [0] * n
for i in range(n):
	(h, b, c) = map(int, input().split())
	a[i] = [max(h, b, c), h + b + c - max(h, b, c) - min(h, b, c), min(h, b, c), i + 1]
a.sort()
best = a[0][2]
ans = a[0][3]
t = 'int'
for i in range(1, n):
	if a[i][2] > best:
		best = a[i][2]
		ans = a[i][3]
		t = 'int'
	if a[i - 1][0] == a[i][0] and a[i - 1][1] == a[i][1] and (min(a[i - 1][2] + a[i][2], a[i][1]) > best):
		best = min(a[i - 1][2] + a[i][2], a[i][1])
		ans = [a[i - 1][3], a[i][3]]
		t = 'list'
if t == 'list':
	print(2)
	print(ans[0], ans[1])
else:
	print(1)
	print(ans)


def define_nearest_primes(n):
	primes = [11, 17, 19, 23, 29, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 1572869]
	for i in range(0, len(primes)):
		if primes[i] > 1.5 * n:
			return primes[i]
	return primes[-1]

def hash_func(box, i, hash_table, biggest_merged_rectangular, p):
	index = (50033 * box[2] + box[1]) % p
	while len(hash_table[index]) > 0 and (box[1] != hash_table[index][0][2] or box[2] != hash_table[index][0][3]):
		index = (index + 1) % p
	if len(hash_table[index]) == 2:
		if box[0] > hash_table[index][0][1]:
			if hash_table[index][0][1] < hash_table[index][1][1]:
				hash_table[index][0] = [i, box[0], box[1], box[2]]
			else:
				hash_table[index][1] = [i, box[0], box[1], box[2]]
		elif box[0] > hash_table[index][1][1]:
			hash_table[index][1] = [i, box[0], box[1], box[2]]
		temp_box = [hash_table[index][0][2], hash_table[index][0][3], hash_table[index][0][1] + hash_table[index][1][1]]
		temp_box = sorted(temp_box)
		if biggest_merged_rectangular[2] < temp_box[0]:
			biggest_merged_rectangular = [hash_table[index][0][0], hash_table[index][1][0], temp_box[0]]
	elif len(hash_table[index]) == 1:
		hash_table[index].append([i, box[0], box[1], box[2]])
		temp_box = [hash_table[index][0][2], hash_table[index][0][3], hash_table[index][0][1] + hash_table[index][1][1]]
		temp_box = sorted(temp_box)
		if biggest_merged_rectangular[2] < temp_box[0]:
			biggest_merged_rectangular = [hash_table[index][0][0], hash_table[index][1][0], temp_box[0]]
	else:
		if biggest_merged_rectangular[2] < box[0]:
			biggest_merged_rectangular = [i, None, box[0]]
		hash_table[index].append([i, box[0], box[1], box[2]])
	return (hash_table, biggest_merged_rectangular)
n = int(input())
p = define_nearest_primes(n)
hash_table = [[] for _ in range(0, p)]
biggest_merged_rectangular = [0, 0, 0]
for i in range(1, n + 1):
	box = list(map(int, input().split()))
	box = sorted(box)
	hashing = hash_func(box, i, hash_table, biggest_merged_rectangular, p)
	(hash_table, biggest_merged_rectangular) = hashing
if biggest_merged_rectangular[1] is None:
	print('1\n{}'.format(biggest_merged_rectangular[0]))
else:
	inds = sorted(biggest_merged_rectangular[:2])
	print('2\n{} {}'.format(inds[0], inds[1]))


n = int(input())
a = []
(ans, u, v) = (0, -1, -1)
for i in range(n):
	t = [int(x) for x in input().split()]
	t.sort()
	if ans < t[0]:
		ans = t[0]
		u = v = i
	t.append(i)
	a.append(t)
from operator import itemgetter
a.sort(key=itemgetter(1, 2, 0), reverse=True)
i = 0
while i + 1 < n:
	if a[i][1:3] == a[i + 1][1:3]:
		t = min(a[i][0] + a[i + 1][0], a[i][1])
		if ans < t:
			ans = t
			u = a[i][3]
			v = a[i + 1][3]
	i += 1
	while (i == 0 or a[i][1:3] == a[i - 1][1:3]) and i + 1 < len(a):
		i += 1
if u == v:
	print(1)
	print(u + 1)
else:
	print(2)
	print(u + 1, v + 1)


n = int(input())
d_max = 0
repo = {}

def update_repo(i, x, y, z):
	if (x, y) in repo:
		(sq1, z1) = repo[x, y]
		if z > z1:
			repo[x, y] = (i + 1, z)
	else:
		repo[x, y] = (i + 1, z)
for i in range(n):
	vals = input().split()
	(a, b, c) = (int(vals[0]), int(vals[1]), int(vals[2]))
	small = min(a, b, c)
	large = max(a, b, c)
	medium = a + b + c - small - large
	if small > d_max:
		d_max = small
		ans_type = 1
		ans_seqNo = i + 1
	if (medium, large) in repo:
		(seqNo, z) = repo[medium, large]
		new_z = z + small
		new_d = min(medium, large, new_z)
		if new_d > d_max:
			d_max = new_d
			ans_type = 2
			ans_seqNo = (seqNo, i + 1)
	update_repo(i, small, medium, large)
	update_repo(i, small, large, medium)
	update_repo(i, medium, large, small)
print(ans_type)
if ans_type == 1:
	print(ans_seqNo)
else:
	print(*ans_seqNo)


n = int(input())
mv = 0
mn = []
data = {}
for i in range(n):
	cur = list(sorted(map(int, input().split())))
	key = (cur[1], cur[2])
	if key in data:
		(old, k) = data[key]
		res = [old + cur[0], cur[1], cur[2]]
		m = min(res)
		if m > mv:
			mv = m
			mn = [k, i]
		if old < cur[0]:
			data[key] = (cur[0], i)
	else:
		data[key] = (cur[0], i)
	m = cur[0]
	if m > mv:
		mv = m
		mn = [i]
print(len(mn))
print(' '.join(map(lambda x: str(x + 1), mn)))


t = {}
p = [sorted(map(int, input().split())) for i in range(int(input()))]
(s, k) = (0, [])
for (i, (x, y, z)) in enumerate(p, 1):
	for (a, b, c) in [(x, y, z), (x, z, y), (y, z, x)]:
		(d, j) = t.get((a, b), (0, 0))
		if j == i:
			continue
		r = min(a, d + c)
		if r > s:
			(s, k) = (r, (2, i, j) if j else (1, i))
		if c > d:
			t[a, b] = (c, i)
for q in k:
	print(q)


def sort_box(box):
	if box[0] > box[1]:
		if box[0] > box[2]:
			if box[1] > box[2]:
				box = [box[2], box[1], box[0]]
			else:
				box = [box[1], box[2], box[0]]
		else:
			box = [box[1], box[0], box[2]]
	elif box[0] < box[2]:
		if box[1] < box[2]:
			box = [box[0], box[1], box[2]]
		else:
			box = [box[0], box[2], box[1]]
	else:
		box = [box[2], box[0], box[1]]
	return box

def hash_func(box, i, hash_table, biggest_merged_rectangular):
	index = (50033 * box[2] + box[1]) % 114997
	while len(hash_table[index]) > 0 and (box[1] != hash_table[index][0][2] or box[2] != hash_table[index][0][3]):
		index = (index + 1) % 114997
	if len(hash_table[index]) == 2:
		if box[0] > hash_table[index][0][1]:
			if hash_table[index][0][1] < hash_table[index][1][1]:
				hash_table[index][0] = [i, box[0], box[1], box[2]]
			else:
				hash_table[index][1] = [i, box[0], box[1], box[2]]
		elif box[0] > hash_table[index][1][1]:
			hash_table[index][1] = [i, box[0], box[1], box[2]]
		temp_box = [hash_table[index][0][2], hash_table[index][0][3], hash_table[index][0][1] + hash_table[index][1][1]]
		temp_box = sort_box(temp_box)
		if biggest_merged_rectangular[2] < temp_box[0]:
			biggest_merged_rectangular = [hash_table[index][0][0], hash_table[index][1][0], temp_box[0]]
	elif len(hash_table[index]) == 1:
		hash_table[index].append([i, box[0], box[1], box[2]])
		temp_box = [hash_table[index][0][2], hash_table[index][0][3], hash_table[index][0][1] + hash_table[index][1][1]]
		temp_box = sort_box(temp_box)
		if biggest_merged_rectangular[2] < temp_box[0]:
			biggest_merged_rectangular = [hash_table[index][0][0], hash_table[index][1][0], temp_box[0]]
	else:
		hash_table[index].append([i, box[0], box[1], box[2]])
	return (hash_table, biggest_merged_rectangular)

def print_result(biggest_rectangular, biggest_merged_rectangular):
	if biggest_rectangular[1] > biggest_merged_rectangular[2]:
		print('1' + '\n' + str(biggest_rectangular[0]))
	elif biggest_merged_rectangular[0] < biggest_merged_rectangular[1]:
		print('2' + '\n' + str(biggest_merged_rectangular[0]) + ' ' + str(biggest_merged_rectangular[1]))
	else:
		print('2' + '\n' + str(biggest_merged_rectangular[1]) + ' ' + str(biggest_merged_rectangular[0]))

def main():
	n = int(input())
	hash_table = [[] for i in range(0, 114997)]
	biggest_rectangular = [0, 0]
	biggest_merged_rectangular = [0, 0, 0]
	for i in range(1, n + 1):
		box = input().split(' ')
		box = [int(box[0]), int(box[1]), int(box[2])]
		if box[1] == box[0] and box[0] == box[2]:
			if biggest_rectangular[1] < box[0]:
				biggest_rectangular[0] = i
				biggest_rectangular[1] = box[0]
		else:
			box = sort_box(box)
			if biggest_rectangular[1] < box[0]:
				biggest_rectangular[0] = i
				biggest_rectangular[1] = box[0]
			hashing = hash_func(box, i, hash_table, biggest_merged_rectangular)
			hash_table = hashing[0]
			biggest_merged_rectangular = hashing[1]
	print_result(biggest_rectangular, biggest_merged_rectangular)
main()


n = int(input())
ans1 = None
ans2 = None
max_size = None
repo = {}
for i in range(n):
	vals = input().split()
	(a, b, c) = (int(vals[0]), int(vals[1]), int(vals[2]))
	l = max(a, b, c)
	s = min(a, b, c)
	m = a + b + c - l - s
	if max_size is None or s > max_size:
		ans1 = 1
		ans2 = i + 1
		max_size = s
	if (s, m) in repo:
		(index, v) = repo[s, m]
		size = min(s, m, v + l)
		if size > max_size:
			ans1 = 2
			ans2 = (index, i + 1)
			max_size = size
		if l > v:
			repo[s, m] = (i + 1, l)
	else:
		repo[s, m] = (i + 1, l)
	if (s, l) in repo:
		(index, v) = repo[s, l]
		size = min(s, l, v + m)
		if size > max_size:
			ans1 = 2
			ans2 = (index, i + 1)
			max_size = size
		if m > v:
			repo[s, l] = (i + 1, m)
	else:
		repo[s, l] = (i + 1, m)
	if (m, l) in repo:
		(index, v) = repo[m, l]
		size = min(m, l, v + s)
		if size > max_size:
			ans1 = 2
			ans2 = (index, i + 1)
			max_size = size
		if s > v:
			repo[m, l] = (i + 1, s)
	else:
		repo[m, l] = (i + 1, s)
print(ans1)
if ans1 == 1:
	print(ans2)
else:
	print(*ans2)


import sys
n = int(sys.stdin.readline()[:-1])
parallels = []
for i in range(n):
	parallels.append(sorted((int(x) for x in sys.stdin.readline()[:-1].split())))

def crit(x):
	return [-a for a in x[1]]
indexed = sorted(enumerate(parallels), key=crit)
current_radius = indexed[0][1][0] / 2
ans = '1\n' + str(indexed[0][0] + 1)

def accoppia(x):
	return (x[1][1], x[1][2], x[1][0])
coppie = sorted(indexed, key=accoppia)
for (i, indice_tripla) in enumerate(coppie):
	for j in range(i + 1, n):
		if indice_tripla[1][1] == coppie[j][1][1] and indice_tripla[1][2] == coppie[j][1][2]:
			a = indice_tripla[1]
			b = coppie[j][1]
			raggio = sorted((b[0] + a[0], a[1], a[2]))[0] / 2
			if raggio > current_radius:
				current_radius = raggio
				ans = '2\n' + str(indice_tripla[0] + 1) + ' ' + str(coppie[j][0] + 1)
			else:
				break
		else:
			break
sys.stdout.write(ans)


n = int(input())
stones = []
d = {}
for _ in range(n):
	l = list(map(int, input().split()))
	l.sort()
	pi = (l[1], l[2])
	if pi not in d:
		d[pi] = []
	d[pi].append((l[0], _))
ans = 0
res = []
for (k, v) in d.items():
	v.sort(reverse=True)
	if len(v) == 1:
		if ans < min(k[0], k[1], v[0][0]):
			ans = min(k[0], k[1], v[0][0])
			res = [v[0][1] + 1]
	elif ans < min(k[0], k[1], v[0][0] + v[1][0]):
		ans = min(k[0], k[1], v[0][0] + v[1][0])
		res = [v[0][1] + 1, v[1][1] + 1]
print(len(res))
print(*res)


n = int(input())
spheres = []
for i in range(n):
	(a, b, c) = map(int, input().split())
	l = [a, b, c]
	l.sort(reverse=True)
	spheres.append((tuple(l), i + 1))
spheres.sort(reverse=True, key=lambda x: x[0])
ans = min(spheres[0][0])
k = 1
ind = [spheres[0][1]]
for i in range(1, n):
	if min(spheres[i][0]) > ans:
		ans = min(spheres[i][0])
		k = 1
		ind = [spheres[i][1]]
	me = spheres[i][0]
	last = spheres[i - 1][0]
	if me[0] == last[0] and me[1] == last[1]:
		rad = min((me[i] for i in range(2)))
		rad = min(me[2] + last[2], rad)
		if rad > ans:
			ans = rad
			k = 2
			ind = [spheres[i - 1][1], spheres[i][1]]
print(k)
if k == 1:
	print(ind[0])
else:
	print(ind[0], ind[1])


import sys
input = sys.stdin.readline
from collections import defaultdict
inf = int(10000000000.0)
n = int(input())
store = []
for i in range(n):
	(a, b, c) = sorted(map(int, input().split()))
	store.append((a, b, c, i))
store.sort()
d = defaultdict(list)
for i in store:
	(v, t) = ((i[0], i[3]), (i[1], i[2]))
	d[t].append(v)
ans = store[-1][0]
(i1, i2) = (-1, -1)
for (k, v) in d.items():
	v.sort(reverse=1)
	if len(v) > 1:
		if min(min(k), v[0][0] + v[1][0]) > ans:
			i1 = v[0][1]
			i2 = v[1][1]
			ans = min(min(k), v[0][0] + v[1][0])
if ans == store[-1][0]:
	print(1)
	print(store[-1][-1] + 1)
else:
	print(2)
	print(i1 + 1, i2 + 1)


import sys
input = sys.stdin.readline
n = int(input())
a = []
for i in range(n):
	a.append(sorted(list(map(int, input().split()))))
b = {}
for i in range(n):
	for j in range(3):
		for k in range(j + 1, 3):
			if (a[i][j], a[i][k]) in b.keys():
				b[a[i][j], a[i][k]].add((a[i][3 - j - k], i))
			else:
				c = ((a[i][3 - j - k], i), (-1, -1))
				b[a[i][j], a[i][k]] = set(c)
c = []
for i in b:
	d = sorted(list(b[i]), reverse=True)[:-1]
	b[i] = d
	if len(d) == 1:
		c.append([min(i[0], i[1], d[0][0]), d[0][1]])
	else:
		c.append([min(i[0], i[1], d[0][0] + d[1][0]), d[0][1], d[1][1]])
e = max(c)
if len(e) == 2:
	print(1)
	print(e[1] + 1)
else:
	print(2)
	print(e[1] + 1, e[2] + 1)


import sys
input = sys.stdin.readline
from collections import defaultdict
n = int(input())
ans_idx_0 = -1
ans_idx_1 = -1
ans_v = 0
d = defaultdict(list)
for i in range(n):
	(a, b, c) = map(int, input().split())
	l = [a, b, c]
	l.sort()
	(a, b, c) = (l[0], l[1], l[2])
	if a > ans_v:
		ans_idx_0 = i
		ans_v = a
	d[10 ** 10 * b + c].append((i, a))
for k in d.keys():
	b = k // 10 ** 10
	d[k].sort(key=lambda t: t[1], reverse=True)
	if len(d[k]) == 1:
		continue
	v = min(d[k][0][1] + d[k][1][1], b)
	if v > ans_v:
		ans_idx_0 = d[k][0][0]
		ans_idx_1 = d[k][1][0]
		ans_v = v
if ans_idx_1 == -1:
	print(1)
	print(ans_idx_0 + 1)
else:
	print(2)
	print(ans_idx_0 + 1, ans_idx_1 + 1)


class HashMap(object):

	def __init__(self, size=256):
		self._keys = []
		self.data = [[0] for i in range(size)]
		self.numItems = 0
		self.size = size

	def __setitem__(self, key, value):
		pos = self.set_find(key)
		if pos != -1:
			if len(self.data[pos]) > 1:
				if self.data[pos][0] == key:
					try:
						self.data[pos] = [key, value]
					except:
						print('Update failed!')
						return False
					return True
			self.data[pos] = [key, value]
			self.numItems += 1
			self._keys.append(key)
			return True
		else:
			return False

	def __missing__(self, not_key):
		raise KeyError('{0} is not a valid key'.format(not_key))

	def __getitem__(self, key):
		pos = self.get_find(key)
		if pos == -1:
			return None
		else:
			return self.data[pos][1]

	def __repr__(self):
		return str(self.data)
		return 'HashMap({0})'.format(list_repr)

	def __contains__(self, key):
		if key in self._keys:
			return True
		else:
			return False

	def __len__(self):
		return len(self._keys)

	def __iter__(self):
		return (key for key in self._keys)

	def hashfunc(self, key):
		print(hash(key))
		return hash(key) % len(self._values)

	def set_find(self, key):
		collisionNum = 0
		currentPos = hash(key) % self.size
		while self.data[currentPos][0] != 0 and self.data[currentPos][0] != key:
			collisionNum += 1
			currentPos = (currentPos + collisionNum ** 2) % self.size
			if collisionNum > self.size:
				return -1
		return currentPos

	def get_find(self, key):
		collisionNum = 0
		currentPos = hash(key) % self.size
		while True:
			while self.data[currentPos][0] != 0 and self.data[currentPos][0] != key:
				collisionNum += 1
				currentPos = (currentPos + collisionNum ** 2) % self.size
				if collisionNum > self.size:
					return -1
			if self.data[currentPos][0] == 0:
				if len(self.data[currentPos]) == 1:
					return -1
				else:
					collisionNum += 1
					currentPos = (currentPos + collisionNum ** 2) % self.size
			else:
				return currentPos

class Item:

	def __init__(self, key, value):
		self.key = key
		self.value = value

class hashTable:

	def __init__(self):
		self.arraysize = 1000000
		self.itemsize = 0
		self.itemarray = [-1] * self.arraysize

	def update(self, newsize):
		oldarray = self.itemarray
		oldsize = self.arraysize
		self.arraysize = newsize
		self.itemarray = [-1] * newsize
		self.itemsize = 0
		for i in range(oldsize):
			if oldarray[i] != -1:
				self.put(oldarray[i].key, oldarray[i].value)

	def put(self, key, value):
		if (self.itemsize + 1) * 3 >= 2 * self.arraysize:
			self.update(self.arraysize * 2)
		position = self.hashing(key)
		if self.itemarray[position] == -1:
			self.itemarray[position] = Item(key, value)
			self.itemsize = 1 + self.itemsize
			return
		else:
			nextposition = position
			count = 1
			while True:
				if self.itemarray[nextposition] == -1:
					self.itemarray[nextposition] = Item(key, value)
					self.itemsize = 1 + self.itemsize
					return
				elif self.itemarray[nextposition].key == key:
					self.itemarray[nextposition].value = value
					return
				nextposition = self.rehash(nextposition, count)
				count = count + 1

	def rehash(self, hashvalue, count):
		return (hashvalue + count ** 2) % self.arraysize

	def hashing(self, key):
		return hash(key) % (self.arraysize - 1)

	def get(self, key):
		position = self.hashing(key)
		if self.itemarray[position] == -1:
			return None
		else:
			nextposition = position
			count = 1
			while True:
				if self.itemarray[nextposition] == -1:
					return None
				elif self.itemarray[nextposition].key == key:
					return self.itemarray[position].value
				nextposition = self.rehash(nextposition, count)
				count = count + 1

	def __getitem__(self, key):
		return self.get(key)

	def __setitem__(self, key, value):
		return self.put(key, value)

	def __len__(self):
		return self.itemsize

	def __contains__(self, key):
		return self.get(key) != None

	def __delitem__(self, key):
		position = self.hashing(key)
		if self.itemarray[position] == -1:
			raise KeyError('%s does not exist' % key)
		else:
			nextposition = position
			count = 1
			while True:
				if self.itemarray[nextposition] == -1:
					raise KeyError('%s does not exist' % key)
				elif self.itemarray[nextposition].key == key:
					self.itemarray[nextposition] = -1
					self.itemsize = self.itemsize - 1
					return
				nextposition = self.rehash(nextposition, count)
				count = count + 1

	def keys(self):
		for i in range(self.arraysize):
			if self.itemarray[i] != -1:
				yield self.itemarray[i].key

	def values(self):
		for i in range(self.arraysize):
			if self.itemarray[i] != -1:
				yield self.itemarray[i].value
answer = 0
min_val = 0
diam = 0
n = int(input())
shapes = hashTable()
for i in range(n):
	face = list(sorted(map(int, input().split())))
	key = (face[1], face[2])
	if key in shapes:
		(old, k) = shapes[key]
		res = [old + face[0], face[1], face[2]]
		m = min(res)
		if m > min_val:
			min_val = m
			diam = m
			mn = [k, i]
		if old < face[0]:
			shapes[key] = (face[0], i)
	else:
		shapes[key] = (face[0], i)
	m = face[0]
	if m > min_val:
		diam = min(face)
		min_val = m
		mn = [i]
print(len(mn))
print(' '.join(map(lambda x: str(x + 1), mn)))


def main():
	from collections import defaultdict
	(d, m) = (defaultdict(list), 0)
	for i in range(1, int(input()) + 1):
		(a, b, c) = sorted(map(int, input().split()))
		d[b, c].append((a, i))
	for ((a, b), l) in d.items():
		if len(l) > 1:
			l.sort()
			(c, i) = l[-1]
			(x, j) = l[-2]
			c += x
		else:
			(c, i) = l[0]
			j = 0
		if a > m < c:
			(m, res) = (a if a < c else c, (i, j))
	print('2\n%d %d' % res if res[1] else '1\n%d' % res[0])
main()


n = int(input())
INF = 10 ** 10
ind = 0
ans = 0
temp = 0
a = []
d = dict()
S = sorted([sorted(list(map(int, input().split())), reverse=True) + [i + 1] for i in range(n)], reverse=True)
ans = S[0][2]
a = [S[0][-1]]
for i in range(1, n):
	if S[i][0] == S[i - 1][0] and S[i][1] == S[i - 1][1]:
		temp = min(S[i][0], S[i][1], S[i][2] + S[i - 1][2])
		if temp > ans:
			ans = temp
			a = [S[i][-1], S[i - 1][-1]]
	elif S[i][2] > ans:
		ans = S[i][2]
		a = [S[i][-1]]
a.sort()
print(len(a))
print(*a)


import random

def get_size(N):
	sizes = [23, 71, 151, 571, 1021, 1571, 5795, 11311, 15451, 50821, 96557, 160001, 262419]
	size = 11
	idx = 0
	while size < 2 * N:
		size = sizes[idx]
		idx += 1
	return size

class Hash(object):

	def __init__(self, size):
		self.size = size
		self.items = [[] for i in range(size)]
		self.p1 = random.randint(1, size - 1)
		self.p2 = random.randint(1, size - 1)

	def count_index(self, b, c):
		return (b * self.p1 + c * self.p2) % self.size

	def get_pair(self, item):
		(a, b, c, num) = item
		idx = self.count_index(b, c)
		arr = self.items[idx]
		cur = None
		for (i, cur) in enumerate(arr):
			if cur[1] == b and cur[2] == c:
				break
			cur = None
		if cur:
			if cur[0] >= a:
				return (cur[-1], item[-1], cur[0] + a)
			else:
				self.items[idx][i] = item
				return (item[-1], cur[-1], cur[0] + a)
		else:
			self.items[idx].append(item)
			return None
N = int(input())
R_max = 0
best_one = None
best_pair = None
if_one = True
size = get_size(N)
hash = Hash(size)
for i in range(N):
	box = input().split()
	box = sorted([int(side) for side in box]) + [i + 1]
	if box[0] > R_max:
		best_one = i + 1
		R_max = box[0]
		if_one = True
	cur_pair = hash.get_pair(box)
	if cur_pair:
		R_paired = min(box[1:-1] + [cur_pair[-1]])
		if R_paired > R_max:
			R_max = R_paired
			best_pair = cur_pair[:-1]
			if_one = False
if if_one:
	print(1)
	print(best_one)
else:
	print(2)
	print(str(best_pair[0]) + ' ' + str(best_pair[1]))


from operator import itemgetter
from collections import defaultdict
n = int(input())
edge_map = defaultdict(set)
dim_len = 3

def process_triple(a, i):
	for i1 in range(dim_len):
		for i2 in range(i1 + 1, dim_len):
			k = dim_len - (i1 + i2)
			edge_map[tuple([a[i1], a[i2]])].add(tuple([i + 1, a[k]]))
for i in range(n):
	x = sorted([int(j) for j in input().split()])
	process_triple(x, i)
max_value = 0
max_arg = []
for edge in edge_map:
	tmp = sorted(list(edge_map[edge]), key=itemgetter(1), reverse=True)
	if len(tmp) == 1:
		if min(edge[0], tmp[0][1]) > max_value:
			max_value = min(edge[0], tmp[0][1])
			max_arg = [tmp[0][0]]
	elif min(tmp[0][1] + tmp[1][1], edge[0]) > max_value:
		max_value = min(tmp[0][1] + tmp[1][1], edge[0])
		max_arg = [tmp[0][0], tmp[1][0]]
print(len(max_arg))
for i in max_arg:
	print(i, end=' ')


n = int(input())
y = []
d = {}
ans = -1
pos1 = -1
pos2 = -1
for i in range(n):
	(a, b, c) = tuple(map(int, input().split()))
	y.append(sorted([a, b, c]))
	if str(min(a, b)) + ' ' + str(max(a, b)) not in d:
		d[str(min(a, b)) + ' ' + str(max(a, b))] = [[c, i + 1]]
	else:
		d[str(min(a, b)) + ' ' + str(max(a, b))].append([c, i + 1])
	if str(min(c, b)) + ' ' + str(max(c, b)) not in d:
		d[str(min(c, b)) + ' ' + str(max(c, b))] = [[a, i + 1]]
	else:
		d[str(min(c, b)) + ' ' + str(max(c, b))].append([a, i + 1])
	if str(min(a, c)) + ' ' + str(max(a, c)) not in d:
		d[str(min(a, c)) + ' ' + str(max(a, c))] = [[b, i + 1]]
	else:
		d[str(min(a, c)) + ' ' + str(max(a, c))].append([b, i + 1])
	if min(a, b, c) / 2 > ans:
		pos1 = i + 1
		ans = min(a, b, c) / 2
for i in d:
	l = sorted(d[i])
	third = l[-1][0]
	p1 = l[-1][1]
	p2 = -1
	(first, second) = (int(i.split()[0]), int(i.split()[1]))
	for i in reversed(range(len(l))):
		if l[i][1] != p1:
			p2 = l[i][1]
			third += l[i][0]
			break
	temp = min(first, second, third) / 2
	if temp > ans:
		ans = temp
		pos1 = p1
		pos2 = p2
if pos2 == -1:
	print(1)
	print(pos1)
else:
	print(2)
	print(pos1, pos2)


read = lambda : map(int, input().split())
n = int(input())
p = [tuple(sorted(read())) for i in range(n)]
d = dict()
ans = []
Max = 0
for i in range(n):
	if p[i][0] > Max:
		Max = p[i][0]
		ans = [i + 1]
for (a, b, c) in p:
	d[a, b] = [0, 0, 0, 0]
	d[b, c] = [0, 0, 0, 0]
	d[a, c] = [0, 0, 0, 0]
perm = ((0, 1, 2), (0, 2, 1), (1, 2, 0))
for i in range(n):
	for (i1, i2, i3) in perm:
		(x, y, z) = (p[i][i1], p[i][i2], p[i][i3])
		if z > d[x, y][0]:
			d[x, y][1] = d[x, y][0]
			d[x, y][3] = d[x, y][2]
			d[x, y][0] = z
			d[x, y][2] = i + 1
		elif z > d[x, y][1]:
			d[x, y][1] = z
			d[x, y][3] = i + 1
for (x, y) in d:
	val = d[x, y][:]
	z = val[0] + val[1]
	cur = min(x, y, z)
	if cur > Max:
		Max = cur
		ans = [val[2], val[3]]
print(len(ans))
print(*ans)


n = int(input())
ans = 0
pr = []
hop = {}
for i in range(n):
	(a, b, c) = list(map(int, input().split()))
	(a, b, c) = (min(a, b, c), a + b + c - min(a, b, c) - max(a, b, c), max(a, b, c))
	if a >= ans:
		ans = a
		pr = [i + 1]
	if (b, c) not in hop:
		hop[b, c] = set()
	d = (a, i + 1)
	hop[b, c].add(d)
for j in hop:
	if len(hop[j]) > 1:
		(max1, max2) = (0, 0)
		(i1, i2) = (0, 0)
		for elem in hop[j]:
			if elem[0] > max2:
				max2 = elem[0]
				i2 = elem[1]
			if max1 < max2:
				(i1, i2) = (i2, i1)
			(max1, max2) = (max(max1, max2), min(max1, max2))
		ile = min(max1 + max2, j[0], j[1])
		if ans <= ile:
			ans = ile
			pr = [i1, i2]
print(len(pr))
print(*pr)


from itertools import combinations

def sides_pairs(box):
	return set((tuple(sorted(side)) for side in combinations(box.dimensions, 2)))

class Box:

	def __init__(self, dimensions, ind):
		self.dimensions = dimensions
		self.ind = ind

class ChainHashSolver:

	def __init__(self):
		self.table = {}
		self.best_boxes = []
		self.diam = 0

	def insert(self, box):
		box_diam = min(box.dimensions)
		if box_diam > self.diam:
			self.diam = box_diam
			self.best_boxes = [box.ind]
		surfaces = sides_pairs(box)
		for surface_sides in surfaces:
			third_side = box.dimensions[:]
			for side in surface_sides:
				third_side.remove(side)
			third_side = third_side[0]
			if surface_sides not in self.table.keys():
				self.table[surface_sides] = (box, third_side)
				continue
			(hashed_box, hashed_side) = self.table[surface_sides]
			stacking_diam = min([third_side + hashed_side] + list(surface_sides))
			if stacking_diam > self.diam:
				self.diam = stacking_diam
				self.best_boxes = [box.ind, hashed_box.ind]
			if third_side > hashed_side:
				self.table[surface_sides] = (box, third_side)
hash_table = ChainHashSolver()
n_boxes = int(input())
for box_num in range(1, n_boxes + 1):
	box = Box(list(map(int, input().split())), box_num)
	hash_table.insert(box)
print(len(hash_table.best_boxes))
print(' '.join(map(str, sorted(hash_table.best_boxes))))


n = int(input())
d = {}
(cnt, ans, ind) = (0, 0, 0)
for i in range(n):
	(a, b, c) = map(int, input().split())
	t = [a, b, c]
	t.sort()
	(a, b, c) = t
	if min(a, b, c) > ans:
		cnt = 1
		ind = i + 1
		ans = min(a, b, c)
	if (b, c) in d:
		d[b, c].append((a, i + 1))
	else:
		d[b, c] = [(a, i + 1)]
for (b, c) in d.keys():
	lis = d[b, c]
	lis.sort()
	if len(lis) > 1:
		if min(b, c, lis[-1][0] + lis[-2][0]) > ans:
			ans = min(b, c, lis[-1][0] + lis[-2][0])
			cnt = 2
			ind = (lis[-1][1], lis[-2][1])
print(cnt)
if cnt == 1:
	print(ind)
else:
	print(ind[0], ind[1])


n = int(input())
L = []
for i in range(n):
	(a, b, c) = sorted(map(int, input().split()))
	L.append((c, b, a, i + 1))
L.sort()
ans_1 = 0
ans_21 = 0
ans_22 = 0
res = 0
f = False
for i in range(1, n):
	if L[i][2] > L[ans_1][2]:
		ans_1 = i
	if L[i][0] == L[i - 1][0] and (not f):
		ans_21 = i - 1
		ans_22 = i
		res = min(L[ans_21][0], L[ans_21][1], L[ans_21][2] + L[ans_22][2])
		f = True
	elif L[i][0] == L[i - 1][0] and L[i][1] == L[i - 1][1]:
		if res < min(L[i][0], L[i][1], L[i][2] + L[i - 1][2]):
			ans_21 = i - 1
			ans_22 = i
			res = min(L[i][0], L[i][1], L[i][2] + L[i - 1][2])
if L[ans_1][2] >= res:
	print(1)
	print(L[ans_1][3])
else:
	print(2)
	print(L[ans_21][3], L[ans_22][3])


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
N = int(input())
G = defaultdict(list)
for i in range(N):
	(a, b, c) = ilele()
	C = sorted([a, b, c])
	(a, b, c) = C
	l = i + 1
	if a == b == c:
		G[a, b].append((c, l))
	elif a == b:
		G[a, b].append((c, l))
		G[b, c].append((a, l))
	elif b == c:
		G[b, c].append((a, l))
		G[a, b].append((c, l))
	else:
		G[a, b].append((c, l))
		G[b, c].append((a, l))
		G[a, c].append((b, l))
maxi = 0
choose1 = None
choose2 = None
for (i, j) in G.items():
	if len(j) == 1:
		m = min(i[0], i[1], j[0][0])
		if m > maxi:
			maxi = m
			choose1 = j[0][1]
			choose2 = None
	else:
		r = heapq.nlargest(2, j)
		m = min(r[0][0] + r[1][0], i[0], i[1])
		if m > maxi:
			maxi = m
			choose1 = r[0][1]
			choose2 = r[1][1]
if choose2 == None:
	print(1)
	print(choose1)
else:
	print(2)
	print(choose1, choose2)


__author__ = 'Think'
from functools import cmp_to_key

def comp(a, b):
	if a[1] != b[1]:
		return a[1] - b[1]
	elif a[2] != b[2]:
		return a[2] - b[2]
	else:
		return a[0] - b[0]
n = int(input())
r = 0
spheres = []
for i in range(1, n + 1):
	sphere = [int(i) for i in input().split()]
	sphere.sort()
	sphere.append(i)
	spheres.append(sphere)
	if sphere[0] > r:
		r = sphere[0]
		best = i
spheres.sort(key=cmp_to_key(comp))
broken = False
for i in range(len(spheres)):
	if spheres[i][1] > r:
		broken = True
		break
if broken:
	prev = spheres[i]
	final = r
	answer = [best]
	for j in range(i + 1, n):
		sphere = spheres[j]
		if sphere[1:3] != prev[1:3]:
			prev = sphere
		else:
			k = min(sphere[2], sphere[1], sphere[0] + prev[0])
			if k > final:
				final = k
				answer = [prev[3], sphere[3]]
			prev = sphere
	if final != r:
		print(2)
		print(answer[0], answer[1])
	else:
		print(1)
		print(answer[0])
else:
	print(1)
	print(best)


n = int(input())
ar = []
for i in range(n):
	kek = list(map(int, input().split()))
	kek.sort()
	ar.append(kek + [i + 1])
ans = 0
kek = [0, 0]
for i in range(n):
	if min(ar[i][0], ar[i][1], ar[i][2]) > ans:
		ans = min(ar[i][0], ar[i][1], ar[i][2])
		kek[0] = ar[i][3]
ar.sort(key=lambda x: [x[0], x[1], x[2]])
for i in range(1, n):
	if ar[i][0] == ar[i - 1][0] and ar[i][1] == ar[i - 1][1]:
		if min(ar[i][2] + ar[i - 1][2], ar[i][0], ar[i][1]) > ans:
			ans = min(ar[i][2] + ar[i - 1][2], ar[i][0], ar[i][1])
			kek = [ar[i][3], ar[i - 1][3]]
ar.sort(key=lambda x: [x[1], x[2], x[0]])
for i in range(1, n):
	if ar[i][2] == ar[i - 1][2] and ar[i][1] == ar[i - 1][1]:
		if min(ar[i][0] + ar[i - 1][0], ar[i][2], ar[i][1]) > ans:
			ans = min(ar[i][0] + ar[i - 1][0], ar[i][2], ar[i][1])
			kek = [ar[i][3], ar[i - 1][3]]
ar.sort(key=lambda x: [x[2], x[0], x[1]])
for i in range(1, n):
	if ar[i][2] == ar[i - 1][2] and ar[i][0] == ar[i - 1][0]:
		if min(ar[i][1] + ar[i - 1][1], ar[i][0], ar[i][2]) > ans:
			min(ar[i][1] + ar[i - 1][1], ar[i][0], ar[i][2])
			kek = [ar[i][3], ar[i - 1][3]]
ar.sort(key=lambda x: x[3])
if kek[1] == 0:
	print(1)
	print(kek[0])
else:
	print(2)
	print(*kek)


n = int(input())
lst = []
for i in range(n):
	lst.append([i + 1] + sorted([int(x) for x in input().split(' ')]))
d = {}
for elem in lst:
	if (elem[3], elem[2]) in d:
		d[elem[3], elem[2]].append((elem[0], elem[1]))
	else:
		d[elem[3], elem[2]] = [(elem[0], elem[1])]
m = 0
ans = []
for pair in d:
	(m1, m2) = (0, 0)
	(i1, i2) = (0, 0)
	for i in range(0, len(d[pair])):
		if d[pair][i][1] > m2:
			m1 = m2
			m2 = d[pair][i][1]
			i1 = i2
			i2 = d[pair][i][0]
		elif d[pair][i][1] > m1:
			m1 = d[pair][i][1]
			i1 = d[pair][i][0]
	if i1 > 0:
		a = min(pair[0], pair[1], m1 + m2)
		if a > m:
			m = a
			ans = [i1, i2]
	else:
		a = min(pair[0], pair[1], m2)
		if a > m:
			m = a
			ans = [i2]
print(len(ans))
print(' '.join([str(x) for x in ans]))


N = int(input())
maxr = 0
maxi = [-1]
sides = {}
for x in range(N):
	cords = [int(x) for x in input().split()]
	cords.sort()
	if (cords[1], cords[2]) in sides:
		sides[cords[1], cords[2]][0].append(cords[0])
		sides[cords[1], cords[2]][1].append(x + 1)
	else:
		sides[cords[1], cords[2]] = [[cords[0]], [x + 1], cords[1]]
	if cords[0] > maxr:
		maxr = cords[0]
		maxi = [x + 1]
for key in sides:
	maxA = 0
	maxB = 0
	Ai = 0
	Bi = 0
	for (i, val) in enumerate(sides[key][0]):
		if maxA < val:
			maxA = val
			Ai = i
	for (i, val) in enumerate(sides[key][0]):
		if i != Ai and maxB < val:
			maxB = val
			Bi = i
	newr2 = min(maxB + maxA, sides[key][2])
	if newr2 > maxr:
		maxr = newr2
		maxi = [sides[key][1][Ai], sides[key][1][Bi]]
if len(maxi) == 1:
	print(1)
	print(maxi[0])
else:
	print(2)
	print(maxi[0], maxi[1])


def check(L, pair, maxVolume):
	dAB = {}
	for i in range(len(L)):
		(a, b, c) = L[i]
		if a > b:
			(a, b) = (b, a)
		l = dAB.get((a, b), [])
		l = l + [(c, int(i / 3) + 1)]
		l.sort()
		dAB[a, b] = l[-2:]
	for (a, b) in dAB:
		if len(dAB[a, b]) < 2:
			continue
		l = dAB[a, b]
		(cFirstMax, p1) = l[0]
		(cSecondMax, p2) = l[1]
		if min(a / 2, b / 2, (cFirstMax + cSecondMax) / 2) > maxVolume:
			maxVolume = min(a / 2, b / 2, (cFirstMax + cSecondMax) / 2)
			pair = [p1, p2]
	return (pair, maxVolume)
N = int(input())
L = []
for n in range(N):
	L.append(list(map(int, input().split())))
maxVolume = 0
pair = []
for i in range(N):
	(a, b, c) = L[i]
	if min(a / 2, b / 2, c / 2) > maxVolume:
		maxVolume = min(a / 2, b / 2, c / 2)
		pair = [i + 1]
x = []
for i in range(N):
	x.append((min(L[i][2], L[i][1]), max(L[i][2], L[i][1]), L[i][0]))
	x.append((min(L[i][0], L[i][2]), max(L[i][0], L[i][2]), L[i][1]))
	x.append((min(L[i][0], L[i][1]), max(L[i][0], L[i][1]), L[i][2]))
(pair, maxVolume) = check(x, pair, maxVolume)
print(len(pair))
pair.sort()
for p in pair:
	print(p, end=' ')
print()


n = int(input())
sidesInfo = {}
lengthsToIndex = {}
for i in range(n):
	sides = [int(side) for side in input().split()]
	sides.sort()
	if sides[2] not in sidesInfo:
		sidesInfo[sides[2]] = {}
	if sides[1] not in sidesInfo[sides[2]]:
		sidesInfo[sides[2]][sides[1]] = []
	sidesInfo[sides[2]][sides[1]].append(sides[0])
	if f'{sides[0]}_{sides[1]}_{sides[2]}' not in lengthsToIndex:
		lengthsToIndex[f'{sides[0]}_{sides[1]}_{sides[2]}'] = []
	lengthsToIndex[f'{sides[0]}_{sides[1]}_{sides[2]}'].append(i + 1)
max_amount = 1
max_combination = ''
max_radius = 0
for sideLen in sidesInfo:
	for sideWid in sidesInfo[sideLen]:
		heightChosen = []
		if len(sidesInfo[sideLen][sideWid]) >= 2:
			sidesInfo[sideLen][sideWid].sort()
			heightChosen.append(sidesInfo[sideLen][sideWid][-2])
			heightChosen.append(sidesInfo[sideLen][sideWid][-1])
		else:
			heightChosen.append(sidesInfo[sideLen][sideWid][0])
		radiusMax = min(sideLen, sideWid, sum(heightChosen))
		if radiusMax > max_radius:
			max_radius = radiusMax
			max_amount = len(heightChosen)
			if max_amount == 2:
				pair = []
				pair.append(lengthsToIndex[f'{heightChosen[0]}_{sideWid}_{sideLen}'][0])
				if heightChosen[0] == heightChosen[1]:
					pair.append(lengthsToIndex[f'{heightChosen[1]}_{sideWid}_{sideLen}'][1])
				else:
					pair.append(lengthsToIndex[f'{heightChosen[1]}_{sideWid}_{sideLen}'][0])
				pair.sort()
				max_combination = ' '.join((str(i) for i in pair))
			else:
				max_combination = lengthsToIndex[f'{heightChosen[0]}_{sideWid}_{sideLen}'][0]
print(max_amount)
print(max_combination)


from collections import defaultdict
n = int(input())
d = defaultdict(list)

def update(a, b, c, i):
	global d
	u = len(d[a, b])
	if u == 0:
		d[a, b].append((c, i + 1))
	elif u == 1:
		if i + 1 == d[a, b][0][1]:
			return
		if c >= d[a, b][0][0]:
			d[a, b].append((c, i + 1))
		else:
			u = d[a, b][0]
			d[a, b][0] = (c, i + 1)
			d[a, b].append(u)
	else:
		u1 = d[a, b][0][1]
		u2 = d[a, b][1][1]
		if i + 1 != u1 and i + 1 != u2:
			if c > d[a, b][0][0]:
				if d[a, b][0][0] == d[a, b][1][0]:
					d[a, b][1] = (c, i + 1)
				elif c > d[a, b][1][0]:
					(d[a, b][0], d[a, b][1]) = (d[a, b][1], (c, i + 1))
				else:
					d[a, b][0] = (c, i + 1)
for i in range(n):
	(a, b, c) = [int(j) for j in input().split()]
	if a > b:
		(a, b) = (b, a)
	if b > c:
		(b, c) = (c, b)
	if a > b:
		(a, b) = (b, a)
	update(a, b, c, i)
	update(b, c, a, i)
	update(a, c, b, i)
max = 0
k = 0
for i in d.keys():
	u = min([i[0], i[1], sum([j[0] for j in d[i]])])
	if u > max:
		max = u
		k = d[i]
print(len(k))
for i in k:
	print(i[1], end=' ')


n = int(input())
data = {}
ans = 0
res = 0
pos = 0
ind = []
for i in range(n):
	tmp = sorted(list(map(int, input().split())))
	if min(tmp) > ans:
		ans = min(tmp)
		ind = [i, -1]
	t = (tmp[1], tmp[2])
	if t in data:
		(third, _) = data[t]
		if min([third + tmp[0], tmp[1], tmp[2]]) > ans:
			ans = min([third + tmp[0], tmp[1], tmp[2]])
			ind = [i, data[t][1]]
		if third < tmp[0]:
			data[t] = (tmp[0], i)
	else:
		data[t] = (tmp[0], i)
if ind[1] == -1:
	print(1)
	print(ind[0] + 1)
else:
	print(2)
	print(ind[0] + 1, ind[1] + 1)


n = int(input())
d = {}
max_value = 0
(max_indx1, max_indx2) = (-1, -1)

def func(x, y, z, indx):
	global max_value, max_indx1, max_indx2
	tpl = (max(x, y), min(x, y))
	if tpl not in d:
		d[tpl] = [[z, indx], [0, -1]]
	elif z > d[tpl][0][0]:
		d[tpl][1] = d[tpl][0]
		d[tpl][0] = [z, indx]
	elif z > d[tpl][1][0]:
		d[tpl][1] = [z, indx]
	if d[tpl][0][0] > 0 and d[tpl][1][0] > 0:
		m = min(x, y, d[tpl][0][0] + d[tpl][1][0])
		if m > max_value:
			max_value = m
			max_indx1 = d[tpl][0][1]
			max_indx2 = d[tpl][1][1]
for i in range(n):
	(a, b, c) = [int(x) for x in input().split()]
	m = min(a, b, c)
	if m > max_value:
		max_value = m
		max_indx1 = i
		max_indx2 = -1
	func(a, b, c, i)
	func(a, c, b, i)
	func(b, c, a, i)
if max_indx2 == -1:
	print(1)
	print(max_indx1 + 1)
else:
	print(2)
	print(max_indx1 + 1, max_indx2 + 1, sep=' ')


from collections import defaultdict
n = int(input())
(ab, bc, ca) = (defaultdict(list), defaultdict(list), defaultdict(list))
(single, double) = (0, 0)
(sidx, didx) = (None, None)
for i in range(1, n + 1):
	(a, b, c) = sorted(map(int, input().split()))
	ab[a, b].append((c, i))
	bc[b, c].append((a, i))
	ca[c, a].append((b, i))
	m = min(a, b, c)
	if m > single:
		single = m
		sidx = i
for d in [ab, bc, ca]:
	for ((p, q), v) in d.items():
		if len(v) <= 1:
			continue
		(*_, (x, xi), (y, yi)) = sorted(v)
		m = min(p, q, x + y)
		if m > double:
			double = m
			didx = (xi, yi)
if single >= double:
	print('1\n%d' % sidx)
else:
	print('2\n%d %d' % didx)


def main():
	(d, m) = ({}, 0)
	for i in range(1, int(input()) + 1):
		(a, b, c) = sorted(map(int, input().split()))
		if (b, c) in d:
			(x, y, z, t) = d[b, c]
			if a > z:
				d[b, c] = (a, i, x, y) if a > x else (x, y, a, i)
		else:
			d[b, c] = (a, i, 0, 0)
	for ((a, b), (x, y, z, t)) in list(d.items()):
		if a > m < x + z:
			(m, res) = (x + z if a > x + z else a, (y, t))
	print('2\n%d %d' % res if res[1] else '1\n%d' % res[0])

def __starting_point():
	main()
__starting_point()


n = int(input())
num = [list(map(int, input().split())) for i in range(n)]
data = dict()
ans = 0
ind = []
for i in range(n):
	(x, y, z) = sorted(num[i])
	if min(x, y, z) > ans:
		ans = min(x, y, z)
		ind = [i]
	if (x, y) in data:
		(zz, j) = data[x, y]
		cur = min(x, y, zz + z)
		if cur > ans:
			ans = cur
			ind = [j, i]
	if (x, z) in data:
		(yy, j) = data[x, z]
		cur = min(x, yy + y, z)
		if cur > ans:
			ans = cur
			ind = [j, i]
	if (y, z) in data:
		(xx, j) = data[y, z]
		cur = min(xx + x, y, z)
		if cur > ans:
			ans = cur
			ind = [j, i]
	if (x, y) in data:
		(zz, j) = data[x, y]
		if z > zz:
			data[x, y] = (z, i)
	else:
		data[x, y] = (z, i)
	if (x, z) in data:
		(yy, j) = data[x, z]
		if y > yy:
			data[x, z] = (y, i)
	else:
		data[x, z] = (y, i)
	if (y, z) in data:
		(xx, j) = data[y, z]
		if x > xx:
			data[y, z] = (x, i)
	else:
		data[y, z] = (x, i)
print(len(ind))
print(' '.join([str(x + 1) for x in ind]))


def add_side(side1, side2, side3, side_dict, num):
	if (side1, side2) not in side_dict:
		side_dict[side1, side2] = [(side3, num)]
	else:
		side_dict[side1, side2].append((side3, num))
		if len(side_dict[side1, side2]) > 2:
			side_dict[side1, side2] = sorted(side_dict[side1, side2])[1:3]
n = int(input())
ans_k = 1
k1 = -1
ans = 0
side_dict = dict()
cubes = list()
for i in range(n):
	sides = sorted([int(x) for x in input().split()])
	cubes.append(sides)
	if sides[0] / 2 > ans:
		k1 = i + 1
		ans = sides[0] / 2
	add_side(sides[0], sides[1], sides[2], side_dict, i)
	if sides[0] == sides[1] and sides[1] == sides[2]:
		pass
	elif sides[0] == sides[1]:
		add_side(sides[0], sides[2], sides[1], side_dict, i)
	elif sides[1] == sides[2]:
		add_side(sides[1], sides[2], sides[0], side_dict, i)
	else:
		add_side(sides[0], sides[2], sides[1], side_dict, i)
		add_side(sides[1], sides[2], sides[0], side_dict, i)
for pair in side_dict:
	if len(side_dict[pair]) > 1:
		sides = sorted([pair[0], pair[1], side_dict[pair][0][0] + side_dict[pair][1][0]])
		if sides[0] / 2 > ans:
			ans = sides[0] / 2
			ans_k = 2
			k1 = side_dict[pair][0][1] + 1
			k2 = side_dict[pair][1][1] + 1
print(ans_k)
if ans_k == 1:
	print(k1)
else:
	print(k1, k2)


n = int(input())
d_max = 0
repo = {}
for i in range(n):
	vals = input().split()
	(a, b, c) = (int(vals[0]), int(vals[1]), int(vals[2]))
	small = min(a, b, c)
	large = max(a, b, c)
	medium = a + b + c - small - large
	if small > d_max:
		d_max = small
		ans_type = 1
		ans_seqNo = i + 1
	if (medium, large) in repo:
		(seqNo, z) = repo[medium, large]
		new_z = z + small
		new_d = min(medium, large, new_z)
		if new_d > d_max:
			d_max = new_d
			ans_type = 2
			ans_seqNo = (seqNo, i + 1)
		if small > z:
			repo[medium, large] = (i + 1, small)
	else:
		repo[medium, large] = (i + 1, small)
print(ans_type)
if ans_type == 1:
	print(ans_seqNo)
else:
	print(*ans_seqNo)


n = int(input())
stones = []
for i in range(n):
	stones.append(list(map(int, input().split())))
	stones[i] = sorted(stones[i])
best_one = (0, min(stones[0]))
for i in range(1, n):
	if min(stones[i]) > best_one[1]:
		best_one = (i, min(stones[i]))
best_two = (-1, -1, -1)
walls = dict()

def addWall(x, y, value, index):
	if (x, y) not in walls:
		walls[x, y] = []
	walls[x, y].append((value, index))
for i in range(n):
	stone = stones[i]
	addWall(stone[0], stone[1], stone[2], i)
	addWall(stone[0], stone[2], stone[1], i)
	addWall(stone[1], stone[2], stone[0], i)
for key in walls:
	walls[key] = sorted(set(walls[key]), reverse=True)

def checkWall(x, y, value, index):
	global best_two
	if len(walls[x, y]) > 1:
		if walls[x, y][0][1] != index:
			res = min(x, y, value + walls[x, y][0][0])
			if res > best_two[2]:
				best_two = (index, walls[x, y][0][1], res)
		else:
			res = min(x, y, value + walls[x, y][1][0])
			if res > best_two[2]:
				best_two = (index, walls[x, y][1][1], res)
for i in range(n):
	stone = stones[i]
	checkWall(stone[0], stone[1], stone[2], i)
	checkWall(stone[0], stone[2], stone[1], i)
	checkWall(stone[1], stone[2], stone[0], i)
if best_one[1] > best_two[2]:
	print(1)
	print(best_one[0] + 1)
else:
	print(2)
	print(best_two[0] + 1, best_two[1] + 1)