def solve():
	try:
		n = int(input())
	except:
		return False
	seq = list(map(int, input().split()))
	if len(seq) == 1:
		print(1)
		return True
	maxlen = 0
	index = None
	for step in range(1, n):
		d = None
		last = None
		length = 0
		for i in range(n-1, -1, -step):
			cur = seq[i]
			length += 1
			if last is not None and d is None:
				d = cur - last
			if last is not None and cur - last != d:
				i += step
				length -= 1
				break
			last = cur
		if length > maxlen:
			maxlen = length
			index = i
	print(index + 1)
	return True

while solve():
	pass
