Everybody knows what an arithmetic progression is. Let us remind you just in case that an arithmetic progression is such sequence of numbers a_1, a_2, ..., a_{n} of length n, that the following condition fulfills: a_2 - a_1 = a_3 - a_2 = a_4 - a_3 = ... = a_{i} + 1 - a_{i} = ... = a_{n} - a_{n} - 1.

For example, sequences [1, 5], [10], [5, 4, 3] are arithmetic progressions and sequences [1, 3, 2], [1, 2, 4] are not.

Alexander has n cards containing integers. Arthur wants to give Alexander exactly one more card with a number so that he could use the resulting n + 1 cards to make an arithmetic progression (Alexander has to use all of his cards).

Arthur has already bought a card but he hasn't written a number on it. Help him, print all integers that you can write on a card so that the described condition fulfilled.


-----Input-----

The first line contains integer n (1 ≤ n ≤ 10^5) — the number of cards. The next line contains the sequence of integers — the numbers on Alexander's cards. The numbers are positive integers, each of them doesn't exceed 10^8.


-----Output-----

If Arthur can write infinitely many distinct integers on the card, print on a single line -1.

Otherwise, print on the first line the number of integers that suit you. In the second line, print the numbers in the increasing order. Note that the numbers in the answer can exceed 10^8 or even be negative (see test samples).


-----Examples-----
Input
3
4 1 7

Output
2
-2 10

Input
1
10

Output
-1

Input
4
1 3 5 9

Output
1
7

Input
4
4 3 4 5

Output
0

Input
2
2 4

Output
3
0 3 6

Difficulty: interview

Starter code:

Solutions:
n=int(input())
a=list(map(int,input().split()))
if n==1:
    print(-1)
    return
a.sort()
d=[]
for i in range(1,n):
    d.append(a[i]-a[i-1])
if min(d)==max(d)==0:
    print(1)
    print(a[0])
elif n==2:
    if d[0]%2:
        print(2)
        print(a[0]-d[0],a[1]+d[0])
    else:
        print(3)
        print(a[0]-d[0],a[0]+d[0]//2,a[1]+d[0])
elif min(d)==max(d):
    print(2)
    print(a[0]-d[0],a[-1]+d[0])
else:
    m1=0
    m2=0
    for i in range(1,n-1):
        if d[i]<d[m1]: m1=i
        if d[i]>d[m2]: m2=i
    c=d.count(d[m1])
    if c==n-2 and d[m1]*2==d[m2]:
        print(1)
        print(a[m2]+d[m1])
    else:
        print(0)

__author__ = 'asmn'
n = int(input())
a = sorted(map(int, input().split()))

#print('begin')


def checked(a, d):
    for i in range(1, len(a)):
        if a[i] - a[i - 1] != d:
            return False
    return True


td = None


def canfix(a):
    a = sorted(a[i] - a[i - 1] for i in range(1, len(a)))
    if a[-1] != a[0] * 2:
        return False
    elif sum(a) != a[0] * (len(a) + 1):
        return False
    else:
        nonlocal td
        td = a[0]
        return True


def fix(a, d):
    for i in range(1, len(a)):
        if a[i] - a[i - 1] != d:
            return a[i] - d


if n == 1:
    print(-1)
elif n == 2:
    if sum(a) % 2 == 0:
        if a[0] == a[1]:
            print(1)
            print(a[0])
        else:
            print(3)
            print(*(2 * a[0] - a[1], sum(a) // 2, 2 * a[1] - a[0]))
    else:
        print(2)
        print(*(2 * a[0] - a[1], 2 * a[1] - a[0]))
else:
    d = a[1] - a[0]
    if checked(a, d):
        if d == 0:
            print(1)
            print(a[0])
        else:
            print(2)
            print(a[0] - d, a[-1] + d)
    elif canfix(a):
        print(1)
        print(fix(a, td))
    else:
        print(0)

# -*- coding: utf-8 -*-

n = int(input())
a = list(map(int, input().split()))

if n == 1:
    print(-1)
    return

a.sort()

d = a[1] - a[0]
if n == 2:
    if d == 0:
        print(1)
        print(a[0])
    elif d % 2 == 1:
        print(2)
        print(a[0]-d, a[1]+d)
    else:
        print(3)
        print(a[0]-d, sum(a)//2, a[1]+d)
    return

d_list = [a[i]-a[i-1] for i in range(1,n)]

#对d_list分类讨论：
#1. 所有值相同
#2. 只有一个值与其他值不同，且为其他值的2倍
#3. 其他情况

d2c = {}
for d in d_list:
    if d not in d2c:
        d2c[d] = 1
    else:
        d2c[d] += 1

if len(d2c) == 1:
    (d1,c1) = d2c.popitem()
    if d1 == 0:
        print(1)
        print(a[0])
    else:
        print(2)
        print(a[0] - d, a[-1] + d)
    return
    
if len(d2c) == 2:
    (d1,c1) = d2c.popitem()
    (d2,c2) = d2c.popitem()
    if c1 == 1 and d1 == d2 * 2:
        print(1)
        print(a[d_list.index(d1)] + d2)
    elif c2 == 1 and d2 == d1 * 2:
        print(1)
        print(a[d_list.index(d2)] + d1)
    else:
        print(0)
else:
    print(0)

n = int(input())
t = list(map(int, input().split()))

if n == 1: q = '-1'
else:
    t.sort()
    d = min(t[1] - t[0], t[-1] - t[-2])
    q = '2\n' + str(t[0] - d) + ' ' + str(t[-1] + d) if d else '1\n' + str(t[0])
    if n == 2:
        if d and d % 2 == 0: q = '3\n' + str(t[0] - d) + ' ' + str(t[0] + d // 2) + ' ' + str(t[-1] + d)
    else:
        for i in range(1, n):
            if t[i] - t[i - 1] != d:
                if t[i] - t[i - 1] == 2 * d and q[0] == '2': q = '1\n' + str(t[i] - d)
                else:
                    q = '0'
                    break
print(q)

n = int(input())
a = sorted((map(int, input().split())))
if n == 1:
  print(-1)
else:
  if a[0] == a[-1]:
    p = [a[0]]
  else:
    p = []
    d = list(set(a[i + 1] - a[i] for i in range(n - 1)))
    if len(d) == 1:
      p = [a[0] - d[0], a[-1] + d[0]]
      if n == 2 and (a[1] - a[0]) % 2 == 0:
        p += [(a[1] + a[0]) // 2]
    elif len(d) == 2:
      if max(d) == 2 * min(d):
        for i in range(n - 1):
          if a[i + 1] - a[i] == max(d):
            if len(p) == 0:
              p = [(a[i + 1] + a[i]) // 2]
            else:
              p = []
              break
  print(len(p))
  print(' '.join(map(str, sorted(p))))

import sys
 
n = int(input())
a = sorted(list(map(int,input().split())))
if n == 1:
    print(-1)
else:
    d = a[1] - a[0]
    x = 0
    v = 0
    t = -1
    v1 = 0
    t1 = -1
    for i in range(1, n):
        if (a[i] - a[i-1] == d):
            x += 1
        elif (a[i] - a[i-1] == 2 * d):
            v += 1
            t = i-1
        elif (2 * (a[i] - a[i-1]) == d):
            v1 += 1
            t1 = i-1
        else:
            print(0)
            return
        if v >= 2:
            print(0)
            return
    if v == 1:
        print(1)
        print(a[t] + d)
        return
    if (v1 > 0) and (v1 + 1 < n - 1):
        print(0)
        return
    if (v1 > 0) and (v1 + 1 == n - 1):
        print(1)
        print(a[0] + d // 2)
        return
    if d == 0:
        print(1)
        print(a[0])
        return
    ans = [a[0] - d]
    if n == 2:
        if d % 2 == 0:
            ans.append(a[0] + (d // 2))
    ans.append(a[n-1] + d)
    print(len(ans))
    for i in ans:
        print(i, end = ' ')

import sys
 
n = int(input())
a = sorted(list(map(int,input().split())))
if n == 1:
    print(-1)
else:
    d = a[1] - a[0]
    x = 0
    v = 0
    t = -1
    v1 = 0
    t1 = -1
    for i in range(1, n):
        if (a[i] - a[i-1] == d):
            x += 1
        elif (a[i] - a[i-1] == 2 * d):
            v += 1
            t = i-1
        elif (2 * (a[i] - a[i-1]) == d):
            v1 += 1
            t1 = i-1
        else:
            print(0)
            return
        if v >= 2:
            print(0)
            return
    if v == 1:
        print(1)
        print(a[t] + d)
        return
    if (v1 > 0) and (v1 + 1 < n - 1):
        print(0)
        return
    if (v1 > 0) and (v1 + 1 == n - 1):
        print(1)
        print(a[0] + d // 2)
        return
    if d == 0:
        print(1)
        print(a[0])
        return
    ans = [a[0] - d]
    if n == 2:
        if d % 2 == 0:
            ans.append(a[0] + (d // 2))
    ans.append(a[n - 1] + d)
    print(len(ans))
    for i in ans:
        print(i, end = ' ')

import sys 
n = int(input())
a = sorted(list(map(int,input().split())))
if n == 1:
    print(-1)
else:
    d = a[1] - a[0]
    x = 0
    v = 0
    t = -1
    v1 = 0
    t1 = -1
    for i in range(1, n):
        if (a[i] - a[i-1] == d):
            x += 1
        elif (a[i] - a[i-1] == 2 * d):
            v += 1
            t = i-1
        elif (2 * (a[i] - a[i-1]) == d):
            v1 += 1
            t1 = i-1
        else:
            print(0)
            return
        if v >= 2:
            print(0)
            return
    if v == 1:
        print(1)
        print(a[t] + d)
        return
    if (v1 > 0) and (v1 + 1 < n - 1):
        print(0)
        return
    if (v1 > 0) and (v1 + 1 == n - 1):
        print(1)
        print(a[0] + d // 2)
        return
    if d == 0:
        print(1)
        print(a[0])
        return
    ans = [a[0] - d]
    if n == 2:
        if d % 2 == 0:
            ans.append(a[0] + (d // 2))
    ans.append(a[n - 1] + d)
    print(len(ans))
    for i in ans:
        print(i, end = ' ')

n = int(input())
num = [int(k) for k in input().split()]
num.sort()
diff = [0]*(n-1)
for i in range(n-1):
    diff[i] = num[i+1]-num[i]
#print(diff)

if n ==1:
    print(-1)
else:
    if len(diff) > 1:
        same = True
        for i in range(len(diff)-1):
            if diff[i] != diff[i+1]:
                same = False
        if same == True:
            if diff[0] == 0:
                print(1)
                print(num[0])
            else:
                print(2)
                print(num[0]-diff[0], num[n-1]+diff[0])
        else:
            if diff.count(diff[diff.index(min(diff))]) != len(diff)-1:
                print(0)
            else:
                if 2*diff[diff.index(min(diff))] != diff[diff.index(max(diff))]:
                    print(0)
                else:
                    print(1)
                    print(num[diff.index(max(diff))]+diff[diff.index(min(diff))])
    elif len(diff) == 1:
        if diff[0] == 0:
            print(1)
            print(num[0])
        else:
            if (num[0] +num[1])/2 % 1 == 0:
                print(3)
                print(num[0]-diff[0], int((num[0] +num[1])/2), num[1]+diff[0])
            else:
                print(2)
                print(num[0]-diff[0], num[1]+diff[0])


def isProgression():
	nonlocal N,A,d,error
	ans = True
	for i in range(N-1):
		if(d!=A[i+1]-A[i]):
			ans = False
			error+=1
	return ans


N = int(input())
A = list(int(i) for i in input().split())
error = 0
A.sort()
d = (A[N-1]-A[0])//N
res = isProgression()
if(error==N-1 and N!=1 and (A[N-1]-A[0])%(N-1)==0):
	d = (A[N-1]-A[0])//(N-1)
	error = 0
	res = isProgression()
	
if(N==1):
	print(-1)
elif(N==2 and (A[0]+A[1])%2==0 and A[0]!=A[1]):
	print(3)
	d = A[1]-A[0]
	print(A[0]-d, (A[0]+A[1])//2, A[1]+d)
elif(res==True and d!=0):
	print(2)
	print(A[0]-d,A[N-1]+d)
elif(res==True):
	print(1)
	print(A[0])
elif(error>1):
	print(0)
else:
	for i in range(N-1):
		if(d!=A[i+1]-A[i]):
			if(A[i+1]-A[i]<d):
				print(0)
			elif(A[i+1]-A[i]==2*d):
				print(1)
				print((A[i]+A[i+1])//2)
			else:
				print(0)
			break


from collections import Counter
n, a = int(input()), sorted(map(int, input().split()))
if n == 1:
    print(-1)
elif a[0] == a[-1]:
    print(1)
    print(a[0])
else:
    d = Counter(a[i + 1] - a[i] for i in range(n - 1))
    if len(d) == 1:
        v = [2 * a[0] - a[1], 2 * a[-1] - a[-2]]
        if len(a) == 2 and sum(a) % 2 == 0:
            v.insert(1, (a[0] + a[1]) // 2)
        print(len(v))
        print(' '.join(map(str, v)))
    else:
        k = sorted(d.keys())
        if len(d) == 2 and d[k[1]] == 1 and k[1] == 2 * k[0]:
            for i in range(n - 1):
                if a[i + 1] - a[i] == k[1]:
                    print(1)
                    print(a[i] + k[0])
        else:
            print(0)


n = int(input())
a = sorted(list(map(int, input().split(' '))))

if n == 1:
    print(-1)
    return

if n == 2 and (a[1]-a[0])%2 == 0 and a[0] != a[1]:
    print(3)
    print(2*a[0]-a[1], (a[0]+a[1])//2, 2*a[1]-a[0])
    return

m = [a[i]-a[i-1] for i in range(1, n)]

if len(set(m)) == 1:
    if m[0] != 0:
        print(2)
        print(a[0]-m[0], a[-1]+m[0])
    else:
        print(1)
        print(a[0])
    return

m.sort()

if len(set(m)) > 2 or m[-1] != 2*m[-2]:
    print(0)
else:
    print(1)
    for i in range(1, n):
        if a[i]-a[i-1] != m[0]:
            print(a[i-1]+m[0])


n = int(input())
a = sorted(list(map(int, input().split(' '))))

if n == 1:
    print(-1)
    return

if n == 2 and (a[1]-a[0])%2 == 0 and a[0] != a[1]:
    print(3)
    print(2*a[0]-a[1], (a[0]+a[1])//2, 2*a[1]-a[0])
    return

m = sorted([a[i]-a[i-1] for i in range(1, n)])

if len(set(m)) == 1:
    if m[0] != 0:
        print(2)
        print(a[0]-m[0], a[-1]+m[0])
    else:
        print(1)
        print(a[0])
    return

if len(set(m)) > 2 or m[-1] != 2*m[-2]:
    print(0)
else:
    print(1)
    for i in range(1, n):
        if a[i]-a[i-1] != m[0]:
            print(a[i-1]+m[0])


n = int(input())

a = [int(i) for i in input().split()]

a = sorted(a)
if len(a) == 1:
    print(-1)
elif len(a) == 2:
    d = a[1] - a[0]
    if d == 0:
        print(1)
        print(a[0])
        return
    elif d%2 == 0:
        print(3)
        print(a[0]-d,int(a[0]+d/2),a[1]+d)
        return
    else:
        print(2)
        print(a[0]-d,a[1]+d)
        return
else:
    d = a[1] - a[0]
    d2 = a[2] - a[1]
    
    if (d != d2):
        if len(a)>3:
            d = a[3] - a[2]
        else:
            d = min(d,d2)
    
    c = 0
    e = 0
    f = 0
    for i in range(len(a)-1):
        if a[i+1] - a[i] != d:
            e = a[i+1] - a[i]
            f = i
            c += 1
        if c == 2:
            print(0)
            return
    if c==0:
        if (d==0):
            print(1)
            print(a[0])
            return
        else:
            print(2)
            print(a[0]-d, a[len(a)-1]+d)
            return
    else:
        if e == 2*d:
            print(1)
            print(a[f]+d)
            return
        else:
            print(0)
            return
    
        
        


def main():
    n = int(input())
    if n == 1:
        print(-1)
        return
    elif n == 2:
        a, b = list(map(int, input().split()))
        res = {a * 2 - b, b * 2 - a}
        if not (a + b) & 1:
            res.add((a + b) // 2)
    else:
        l = sorted(map(int, input().split()))
        d, a = {}, -l[-1]
        for i, b in enumerate(l):
            x, a = b - a, b
            cnt, _ = d.get(x, (0, 0))
            d[x] = (cnt + 1, b)
        t = sorted(d.items())
        if len(t) == 2:
            y, (_, b) = t[0]
            res = {l[0] - y, b + y}
        elif len(t) == 3:
            (x, _), (y, (c2, b)), _ = t
            if not x or c2 > 1 or x * 2 != y:
                res = ()
            else:
                res = (b - x,)
        else:
            res = ()
    print(len(res))
    if res:
        print(*sorted(res))


def __starting_point():
    main()

__starting_point()

def main():
    n = int(input())
    l = sorted(map(int, input().split()))
    if n == 1:
        print(-1)
        return
    elif n == 2:
        a, b = l
        res = {a * 2 - b, b * 2 - a}
        if not (a + b) & 1:
            res.add((a + b) // 2)
    else:
        q = min(l[1] - l[0], l[-1] - l[-2])
        a, res = l[0] - q, ()
        for b in l:
            if q != b - a:
                if res or q * 2 != b - a:
                    res = ()
                    break
                else:
                    res = (b - q,)
            a = b
        else:
            if not res:
                res = {l[0] - q, b + q}
    print(len(res))
    if res:
        print(*sorted(res))


def __starting_point():
    main()

__starting_point()

n = int(input())
array = sorted(list(map(int, input().split())))

def all_same(items):
    return all(x == items[0] for x in items)

if n == 1:
    print(-1)

elif n == 2:
    t = (max(array) - min(array))
    if t == 0:
        print(1)
        print(array[0])
    elif t % 2 == 0:
        print(3)
        print(min(array) - t, int(min(array) + t / 2), max(array) + t)
    else:
        print(2)
        print(min(array) - t, max(array) + t)
else:
    diff = [array[i + 1] - array[i] for i in range(n - 1)]

    if all_same(diff):
        t = array[1] - array[0]

        if t == 0:
            print(1)
            print(array[0])
        else:
            print(2)
            print(min(array) - t, max(array) + t)

    else:
        if max(diff) ==  2 * min(diff) and diff.count(max(diff)) == 1:
            print(1)
            print(array[diff.index(max(diff))] + min(diff))
            
        else:
            print(0)

n=int(input())
li=list(map(int,input().split()))
if n==1:
    print(-1)
elif n==2:
    li.sort()
    d=li[1]-li[0]
    if d==0:
        print(1)
        print(li[0])
    elif d%2==0:
        print(3)
        print(li[0]-d,li[0]+d//2,li[1]+d)
    else:
        print(2)
        print(li[0]-d,li[1]+d)
else:
    flag=0
    li.sort()
    d=li[1]-li[0]
    for i in range(2,n):
        if li[i]-li[i-1]<d:
            d=li[i]-li[i-1]
    for i in range(1,n):
        if (li[i]-li[i-1])!=d:
            if li[i]-li[i-1]==2*d:
                flag+=1
                ind=i
            else:
                flag=-1
                break
    if d==0 and flag==0:
        print(1)
        print(li[0])
    elif flag==-1 or flag>1:
        print(0)
    elif flag==1:
        print(1)
        print(li[ind]-d)
    else:
        print(2)
        print(li[0]-d,li[-1]+d)


n = int(input())
a = sorted((list(map(int, input().split()))))
if n == 1:
  print(-1)
else:
  if a[0] == a[-1]:
    p = [a[0]]
  else:
    p = []
    d = list(set(a[i + 1] - a[i] for i in range(n - 1)))
    if len(d) == 1:
      p = [a[0] - d[0], a[-1] + d[0]]
      if n == 2 and (a[1] - a[0]) % 2 == 0:
        p += [(a[1] + a[0]) // 2]
      #print(p)
    elif len(d) == 2:
      if max(d) == 2 * min(d):
        for i in range(n - 1):
          if a[i + 1] - a[i] == max(d):
            if len(p) == 0:
              p = [(a[i + 1] + a[i]) // 2]
            else:
              p = []
              break
  print(len(p))
  print(' '.join(map(str, sorted(p))))


n=int(input())
a=sorted(map(int,input().split()))
if (n<2):
    print(-1)
else:
    count={}
    I=range(n-1)
    for i in I:
        d=a[i+1]-a[i]
        count[d]=count.get(d,0)+1
    d=min(count)
    if( count[d]<n-2):
        print(0)
    else:
        b=set()
        if( count[d]+1==n):
          b.add(int(a[0]*2-a[1]))
          b.add(int(a[-1]*2-a[-2]))
        for i in I:
          e=a[i+1]-a[i]
          if(not e%2):
            f=e/2
            count[f]=count.get(f,0)+2
            count[e]-=1
            if(count[min(d,f)]==n):
              b.add(int(a[i]+f))
            count[e]+=1
            count[f]-=2
        print(len(b))
        print(' '.join(map(str,sorted(b))))

n = int(input())
a = sorted(list(map(int, input().split(' '))))

if n == 1:
    print(-1)
    return

if n == 2 and (a[1]-a[0])%2 == 0 and a[0] != a[1]:
    print(3)
    print(2*a[0]-a[1], (a[0]+a[1])//2, 2*a[1]-a[0])
    return

m = [a[i]-a[i-1] for i in range(1, n)]

if len(set(m)) == 1:
    if m[0] != 0:
        print(2)
        print(a[0]-m[0], a[-1]+m[0])
    else:
        print(1)
        print(a[0])
    return

m.sort()

if len(set(m)) > 2 or m[-1] != 2*m[-2]:
    print(0)
else:
    print(1)
    for i in range(1, n):
        if a[i]-a[i-1] != m[0]:
            print(a[i-1]+m[0])

n = int(input())
a = sorted((map(int, input().split())))
if n == 1:
  print(-1)
else:
  if a[0] == a[-1]:
    p = [a[0]]
  else:
    p = []
    d = list(set(a[i + 1] - a[i] for i in range(n - 1)))
    if len(d) == 1:
      p = [a[0] - d[0], a[-1] + d[0]]
      if n == 2 and (a[1] - a[0]) % 2 == 0:
        p += [(a[1] + a[0]) // 2]
    elif len(d) == 2:
      if max(d) == 2 * min(d):
        for i in range(n - 1):
          if a[i + 1] - a[i] == max(d):
            if len(p) == 0:
              p = [(a[i + 1] + a[i]) // 2]
            else:
              p = []
              break
  print(len(p))
  print(' '.join(map(str, sorted(p))))

n=int(input())
a=list(map(int,input().split()))
if n==1:
    print(-1)
    return
a.sort()
d=[]
for i in range(1,n):
    d.append(a[i]-a[i-1])
if min(d)==max(d)==0:
    print(1)
    print(a[0])
elif n==2:
    if d[0]%2:
        print(2)
        print(a[0]-d[0],a[1]+d[0])
    else:
        print(3)
        print(a[0]-d[0],a[0]+d[0]//2,a[1]+d[0])
elif min(d)==max(d):
    print(2)
    print(a[0]-d[0],a[-1]+d[0])
else:
    m1=0
    m2=0
    for i in range(1,n-1):
        if d[i]<d[m1]: m1=i
        if d[i]>d[m2]: m2=i
    c=d.count(d[m1])
    if c==n-2 and d[m1]*2==d[m2]:
        print(1)
        print(a[m2]+d[m1])
    else:
        print(0)

n=int(input())
a=list(map(int,input().split()))
if n==1:
    print(-1)
    return
a.sort()
d=[]
for i in range(1,n):
    d.append(a[i]-a[i-1])
if min(d)==max(d)==0:
    print(1)
    print(a[0])
elif n==2:
    if d[0]%2:
        print(2)
        print(a[0]-d[0],a[1]+d[0])
    else:
        print(3)
        print(a[0]-d[0],a[0]+d[0]//2,a[1]+d[0])
elif min(d)==max(d):
    print(2)
    print(a[0]-d[0],a[-1]+d[0])
else:
    m1=0
    m2=0
    for i in range(1,n-1):
        if d[i]<d[m1]: m1=i 
        if d[i]>d[m2]: m2=i
    c=d.count(d[m1])
    if  c==n-2 and d[m1]*2==d[m2]:
        print(1)
        print(a[m2]+d[m1])
    else:
        print(0)


n=int(input())
a=list(map(int,input().split()))
a.sort()
cnt=0
if n==1:
	print(-1)
	return
if n==2:
	if((a[1]-a[0])%2==0 and a[1]!=a[0]):
		print(3)
		print(2*a[0]-a[1],(a[0]+a[1])//2,2*a[1]-a[0])
		return
d=sorted([a[i]-a[i-1] for i in range(1, n)])
if len(set(d))==1:
    if d[0]!=0:
        print(2)
        print(a[0]-d[0], a[-1]+d[0])
    else:
        print(1)
        print(a[0])
    return
if len(set(d)) > 2 or d[-1]!=2*d[-2]:
    print(0)
else:
    print(1)
    for i in range(1, n):
        if a[i]-a[i-1] != d[0]:
            print(a[i-1]+d[0])