import static java.time.Clock.system;
import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static void main(String[] args) {
        public String printMessage = "";
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate ";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love ";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static int feelingNum = 0 ;
    public static String printMessage ="";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate ";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love ";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.*;
public class hulk {

    public static void main(String[] args) {
    	Scanner sc=new Scanner(System.in);
    	int n=sc.nextInt();
    	boolean flag=true;
    	String s="";
    	for(int i=0;i<n;i++){
    		if(flag==true){
    			s="hate";
    		    flag=false;
    		}
    		else{
    			s="love";
    			flag=true;
    		}
    		System.out.print("I"+" "+s);
    		if((i+1)<n)
    			System.out.print(" that ");

    	}
    	System.out.print(" it.");
    }
}


import java.util.*;
public class hulk {

    public static void main(String[] args) {
    	Scanner sc=new Scanner(System.in);
    	int n=sc.nextInt();
    	boolean flag=true;
    	String s="";
    	for(int i=0;i<n;i++){
    		if(flag==true)
    		{s="hate";
    		flag=false;}
    		else{
    			s="love";
    			flag=true;
    		}
    		System.out.print("I"+" "+s);
    		flag=false;
    		if((i+1)<n)
    			System.out.print(" that ");

    	}
    	System.out.print(" it");
    }
}


public class hulk {

    public static void main(String[] args) {
    	Scanner sc=new Scanner(System.in);
    	int n=sc.nextInt();
    	boolean flag=true;
    	String s="";
    	for(int i=0;i<n;i++){
    		if(flag==true)
    		{s="hate";
    		flag=false;}
    		else{
    			s="love";
    			flag=true;
    		}
    		System.out.print("I"+" "+s);
    		flag=false;
    		if((i+1)<n)
    			System.out.print(" that ");

    	}
    	System.out.print(" it");
    }
}


import java.util.*;
public class hulk {

    public static void main(String[] args) {
    	Scanner sc=new Scanner(System.in);
    	int n=sc.nextInt();
    	boolean flag=true;
    	String s="";
    	for(int i=0;i<n;i++){
    		if(flag==true){
    			s="hate";
    		    flag=false;
    		}
    		else{
    			s="love";
    			flag=true;
    		}
    		System.out.print("I"+" "+s);
    		if((i+1)<n)
    			System.out.print(" that ");

    	}
    	System.out.print(" it");
    }
}


import java.util.*;
public class hulk {

    public static void main(String[] args) {
    	Scanner sc=new Scanner(System.in);
    	int n=sc.nextInt();
    	boolean flag=true;
    	String s="";
    	if(n==1)
    		System.out.println("I hate it");
    	else{
    		for(int i=0;i<n;i++){
    		if(flag==true){
    			s="hate";
    		    flag=false;
    		}
    		else{
    			s="love";
    			flag=true;
    		}
    		System.out.print("I"+" "+s);
    		if((i+1)<n)
    			System.out.print(" that ");

    	}
    	System.out.print(" it");
    	}
    }
}


import java.util.*;
public class hulk {

    public static void main(String[] args) {
    	Scanner sc=new Scanner(System.in);
    	int n=sc.nextInt();
    	boolean flag=true;
    	String s="";
    	if(n==1)
    		System.out.println("I hate it.");
    	else{
    		for(int i=0;i<n;i++){
    		if(flag==true){
    			s="hate";
    		    flag=false;
    		}
    		else{
    			s="love";
    			flag=true;
    		}
    		System.out.print("I"+" "+s);
    		if((i+1)<n)
    			System.out.print(" that ");

    	}
    	System.out.print(" it.");
    	}
    }
}


package aProblems;

import java.util.Arrays;
import java.util.Scanner;

public class DrHulk {

	private static String L = "I love it";

	private static String H = "I hate it";

	public static void main(String[] args) {
		Scanner rd = new Scanner(System.in);

		String firstLine = rd.nextLine();

		int layers = Integer.parseInt(firstLine);

		String a[] = new String[layers];

		for (int i = 0; i < a.length; i++) {
			if(a[0]==null) {
				a[0]=H;
			}else {
				if(i%2==0) {
					a[i]=H;
				}else {
					a[i]=L;
				}
			}
		}
		show(a);
	}

	private static void show(String[] a) {
		String r = "";
		for (int i = 0; i < a.length; i++) {
			r+= a[i]+" ";
		}
		System.out.println(r);
	}


import java.util.Arrays;
import java.util.Scanner;

public class DrHulk {

	private static String L = "I love it";

	private static String H = "I hate it";

	public static void main(String[] args) {
		Scanner rd = new Scanner(System.in);

		String firstLine = rd.nextLine();

		int layers = Integer.parseInt(firstLine);

		String a[] = new String[layers];

		for (int i = 0; i < a.length; i++) {
			if(a[0]==null) {
				a[0]=H;
			}else {
				if(i%2==0) {
					a[i]=H;
				}else {
					a[i]=L;
				}
			}
		}
		System.out.println(Arrays.toString(a));
	}

}


import java.util.Scanner;

public class DrHulk {

	private static String L = "I love it";

	private static String H = "I hate that";

	public static void main(String[] args) {
		Scanner rd = new Scanner(System.in);

		String firstLine = rd.nextLine();

		int layers = Integer.parseInt(firstLine);

		String a[] = new String[layers];

		for (int i = 0; i < a.length; i++) {
			if(a[0]==null) {
				a[0]=H;
			}else {
				if(i%2==0) {
					a[i]=H;
				}else {
					a[i]=L;
				}
			}
		}
		rd.close();
		show(a);
	}

	private static void show(String[] a) {
		String r = "";
		for (int i = 0; i < a.length; i++) {
			r+= a[i]+" ";
		}
		System.out.println(r);
	}

}


import java.util.Scanner;

public class DrHulk {

	private static String Lt = "I love that";

	private static String Ht = "I hate that";

	private static String Li = "I love it";

	private static String Hi = "I hate it" ;

	public static void main(String[] args) {
		Scanner rd = new Scanner(System.in);

		String firstLine = rd.nextLine();

		int layers = Integer.parseInt(firstLine);

		String a[] = new String[layers];
		int n = a.length;
		for (int i = 0; i < n; i++) {
			if(n==1) {
				a[0]=Hi;
				}else {
					if(i<n-1) {
						if(i%2!=0) {
							a[i]=Lt;
					}else {
						a[i]=Ht;
					}
				}else {
					System.out.println(n);
					if((n-1)%2==0){
						a[i]=Hi;
					}else {
						a[i]=Li;
					}
				}
			}
		}rd.close();
		show(a);
		}

	private static void show(String[] a) {
		String r = "";
		for (int i = 0; i < a.length; i++) {
			r+= a[i]+" ";
		}
		System.out.println(r);
	}

}


import java.util.Scanner;

public class DrHulk {

	private static String L = "I love it";

	private static String H = "I hate it";

	public static void main(String[] args) {
		Scanner rd = new Scanner(System.in);

		String firstLine = rd.nextLine();

		int layers = Integer.parseInt(firstLine);

		String a[] = new String[layers];

		for (int i = 0; i < a.length; i++) {
			if(a[0]==null) {
				a[0]=H;
			}else {
				if(i%2==0) {
					a[i]=H;
				}else {
					a[i]=L;
				}
			}
		}
		rd.close();
		show(a);
	}

	private static void show(String[] a) {
		String r = "";
		for (int i = 0; i < a.length; i++) {
			r+= a[i]+" ";
		}
		System.out.println(r);
	}

}


import java.util.Scanner;

public class DrHulk {

	private static String Lt = "I love that";

	private static String Ht = "I hate that";

	private static String Li = "I love it";

	private static String Hi = "I hate it" ;

	public static void main(String[] args) {
		Scanner rd = new Scanner(System.in);

		String firstLine = rd.nextLine();

		int layers = Integer.parseInt(firstLine);

		String a[] = new String[layers];
		int n = a.length;
		for (int i = 0; i < n; i++) {
			if(n==1) {
				a[0]=Hi;
				}else {
					if(i<n-1) {
						if(i%2!=0) {
							a[i]=Lt;
					}else {
						a[i]=Ht;
					}
				}else {
					if((n-1)%2==0){
						a[i]=Hi;
					}else {
						a[i]=Li;
					}
				}
			}
		}rd.close();
		show(a);
		}

	private static void show(String[] a) {
		String r = "";
		for (int i = 0; i < a.length; i++) {
			r+= a[i]+" ";
		}
		System.out.println(r);
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Hulk {
public static void main(String[] args) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String x = br.readLine();
	int y = Integer.parseInt(x);
	for (int i = 1 ; i<y ; i++ )
	{
		if(i%2 == 1)

			System.out.print("I hate that ");
		if ( i%2 == 0)
			System.out.print(" I love that");
	}
	if(y!= 0 )
	{
	if ( y%2 ==1)
		System.out.println(" I hate it ");
	else
		System.out.println("I love it");
	}

}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Hulk {
public static void main(String[] args) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String x = br.readLine();
	int y = Integer.parseInt(x);
	for (int i = 1 ; i<y ; i++ )
	{
		if(i%2 == 1)

			System.out.print("I Hate that ");
		if ( i%2 == 0)
			System.out.print(" I love that");
	}
	if(y!= 0 )
	{
	if ( y%2 ==1)
		System.out.println(" I hate it ");
	else
		System.out.println("I love it");
	}

}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Hulk {
public static void main(String[] args) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String x = br.readLine();
	int y = Integer.parseInt(x);
	for (int i = 1 ; i<y ; i++ )
	{
		if(i%2 == 1)

			System.out.print("I hate that ");
		if ( i%2 == 0)
			System.out.print("I love that ");
	}
	if(y!= 0 )
	{
	if ( y%2 ==1)
		System.out.println("I hate it ");
	else
		System.out.println("I love it ");
	}

}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Hulk {
public static void main(String[] args) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String x = br.readLine();
	int y = Integer.parseInt(x);
	for (int i = 1 ; i<y ; i++ )
	{
		if(i%2 == 1)

			System.out.print("I Hate that ");
		if ( i%2 == 0)
			System.out.print(" I love that");
	}
	if(y!= 0 )
	{
	if ( y%2 ==1)
		System.out.println(" I hate it ");
	else
		System.out.println("I love it");
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Hulk {
public static void main(String[] args) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String x = br.readLine();
	int y = Integer.parseInt(x);
	for (int i = 1 ; i<y ; i++ )
	{
		if(i%2 == 1)

			System.out.print(" I Hate that ");
		if ( i%2 == 0)
			System.out.print("I love that");
	}
	if(y!= 0 )
	{
	if ( y%2 ==1)
		System.out.println(" I hate it ");
	else
		System.out.println("I love it");
	}

}

}


import java.util.Scanner;
public class main{
    public static void main(String[] args){
              Scanner sc=new Scanner(System.in);
	// your code goes here

        int num=sc.nextInt();

        System.out.print("I hate ");
        for(int i=1;i<num;i++)
        {
            System.out.print("that ");
            if(i%2==1)
                System.out.print("I love ");
                else
                System.out.print("I hate ");
        }
        System.out.println("it");

            }

	}


import java.util.Scanner;
public class main{
    public static void main(String[] args){
              Scanner sc=new Scanner(System.in);
	// your code goes here

        int num=sc.nextInt();
        int t;
        t=(num-1)/2;
        if(num==2)
        System.out.print("I hate that ");
        for(int i=0;i<num/2;i++)
        {
            System.out.print("I hate that ");
            if(t>0)
            {
                System.out.print("I love that ");
            t--;

            }

	}

	if(num%2==0)
	System.out.println("I love it");
	else
	System.out.println("I hate it");

}
}


import java.util.Scanner;
public class main{
    public static void main(String[] args){
              Scanner sc=new Scanner(System.in);
	// your code goes here

        int num=sc.nextInt();
        int t;
        t=(num-1)/2;
        if(num==2)
        System.out.print("I hate that ");
         for(int i=1;i<=num/2;i++)
        {
            System.out.print("I hate that ");
            if(t>0)
            {
                System.out.print("I love that ");
            t=t/2;

            }

	}

	if(num%2==0)
	System.out.println("I love it ");
	else
	System.out.println("I hate it ");

}
}


mport java.util.Scanner;
public class main{
    public static void main(String[] args){
              Scanner sc=new Scanner(System.in);
	// your code goes here

        int num=sc.nextInt();

        System.out.print("I hate ");
        for(int i=1;i<num;i++)
        {
            System.out.print("that ");
            if(i%2==1)
                System.out.print("I love ");
                else
                System.out.print("I hate ");
        }
        System.out.println("it");

            }

	}


import java.util.Scanner;
public class main{
    public static void main(String[] args){
              Scanner sc=new Scanner(System.in);
	// your code goes here

        int num=sc.nextInt();
        int t;
        t=(num-1)/2;
        if(num==2)
        System.out.print("I hate that ");
        for(int i=1;i<num-1;i=i*2)
        {
            System.out.print("I hate that ");
            if(t>0)
            {
                System.out.print("I love that ");
            t=t/2;

            }

	}

	if(num%2==0)
	System.out.println("I love it ");
	else
	System.out.println("I hate it ");

}
}


import java.util.Scanner;
public class main{
    public static void main(String[] args){
              Scanner sc=new Scanner(System.in);
	// your code goes here

        int num=sc.nextInt();
        int t;
        t=(num-1)/2;
        if(num==2)
        System.out.print("I hate that ");
        for(int i=1;i<=num/2;i++)
        {
            System.out.print("I hate that ");
            if(t>0)
            {
                System.out.print("I love that ");
            t--;

            }

	}

	if(num%2==0)
	System.out.println("I love it ");
	else
	System.out.println("I hate it ");

}
}


public class Hulk{
Scanner sc= new Scanner(System.in);
int x= sc.nextInt();
if(n==1)
System.out.print("I hate it");
if(n==2)
System.out.print("I love it");
for(int i=1;i<n;i++){
	if(i%2==0)
		System.out.print("I love that ");
		else{
			System.out.print("I hate that ");
		}

}
if(n%2==0)
System.out.print("I love it");
else
System.out.print("I hate it");
}


public class Hulk{
	public static void main(String[] Args){
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
if(n==1)
System.out.print("I hate it");
if(n==2)
System.out.print("I love it");
else{

for(int i=1;i<n;i++){
	if(i%2==0){
		System.out.print("I love that ");}
		else{
			System.out.print("I hate that ");
		}
}
if(n%2==0){
System.out.print("I love it");}
else{
	if(n%2!=0 && n!=1)
System.out.print("I hate it");}
	}
	}
}


import java.util.*;
public class Hulk{
	public static void main(String[] Args){
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
if(n==1)
System.out.print("I hate it");
if(n==2)
System.out.print("I love it");
for(int i=1;i<n;i++){
	if(i%2==0){
		System.out.print("I love that ");}
		else{
			System.out.print("I hate that ");
		}
}
if(n%2==0){
System.out.print("I love it");}
else{
System.out.print("I hate it");}
	}
}


import java.util.*;
public class Hulk{
	public static void main(String[] Args){
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
if(n==1)
System.out.print("I hate it");
if(n==2)
System.out.print("I love it");
else{

for(int i=1;i<n;i++){
	if(i%2==0){
		System.out.print("I love that ");}
		else{
			System.out.print("I hate that ");
		}
}
if(n%2==0){
System.out.print("I love it");}
else{
System.out.print("I hate it");}
	}
	}
}


import java.util.*;
public class Hulk{
	public static void main(String[] Args){
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
if(n==1)
System.out.print("I hate it");
if(n==2)
System.out.print("I love it");
else{

for(int i=1;i<n;i++){
	if(i%2==0){
		System.out.print("I love that ");}
		else{
			System.out.print("I hate that ");
		}
}
if(n%2==0){
System.out.print("I love it");}
else{
	if(n%2!=0 && n!=1)
System.out.print("I hate it");}
	}
	}
}


public class Hulk{
	public static void main(String[] Args){
Scanner sc= new Scanner(System.in);
int x= sc.nextInt();
if(n==1)
System.out.print("I hate it");
if(n==2)
System.out.print("I love it");
for(int i=1;i<n;i++){
	if(i%2==0){
		System.out.print("I love that ");}
		else{
			System.out.print("I hate that ");
		}
}
if(n%2==0){
System.out.print("I love it");}
else{
System.out.print("I hate it");}
	}
}


import java.util.*;
public class Hulk{
	public static void main(String[] Args){
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
if(n==1)
System.out.print("I hate it");
if(n==2)
System.out.print("I hate that i love it");
else{

for(int i=1;i<n;i++){
	if(i%2==0){
		System.out.print("I love that ");}
		else{
			System.out.print("I hate that ");
		}
}
if(n%2==0){
System.out.print("I love it");}
else{
	if(n%2!=0 && n!=1)
System.out.print("I hate it");}
	}
	}
}


import java.util.*;
public class Hulk{
	public static void main(String[] Args){
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
if(n==1)
System.out.print("I hate it");
if(n==2)
System.out.print("I hate that I love it");
else{

for(int i=1;i<n;i++){
	if(i%2==0){
		System.out.print("I love that ");}
		else{
			System.out.print("I hate that ");
		}
}
if(n%2==0){
System.out.print("I love it");}
else{
	if(n%2!=0 && n!=1)
System.out.print("I hate it");}
	}
	}
}


public class Hulk{
	public static void main(String[] Args){
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
if(n==1)
System.out.print("I hate it");
if(n==2)
System.out.print("I love it");
for(int i=1;i<n;i++){
	if(i%2==0){
		System.out.print("I love that ");}
		else{
			System.out.print("I hate that ");
		}
}
if(n%2==0){
System.out.print("I love it");}
else{
System.out.print("I hate it");}
	}
}


import java.util.*;
public class Main{

	public static void main (String[]args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(0<n&&n<100){
		for(int i = 1; i<n+1 ;i++){
			if(i%2==1)
				System.out.print("I hate");
			else
				System.out.print("I love");
			if(i==n)
				System.out.print(" it ");
			else
				System.out.print(" that ");

		}}
	}
}


import java.util.*;
public class Main6{

	public static void main (String[]args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(0<=n&&n<=100){
		for(int i = 1; i<n+1 ;i++){
			if(i%2==1)
				System.out.print("I hate");
			else
				System.out.print("I love");
			if(i==n)
				System.out.print(" it ");
			else
				System.out.print(" that ");

		}}
	}
}


import java.util.*;
public class Main2{

	public static void main (String[]args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 0; i<n ;i++){
			if(i%2==1)
				System.out.print("I hate");
			else
				System.out.print("I love");
			if(i==n-1)
				System.out.print(" it ");
			else
				System.out.print(" that ");

		}
	}
}


import java.util.*;
public class Main{

	public static void main (String[]args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(0<=n&&n<=100){
		for(int i = 1; i<n+1 ;i++){
			if(i%2==1)
				System.out.print("I hate");
			else
				System.out.print("I love");
			if(i==n)
				System.out.print(" it ");
			else
				System.out.print(" that ");

		}}
	}
}


import java.util.*;
public class Main{

	public static void main (String[]args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 0; i<n ;i++){
			if(i%2==1)
				System.out.print("I hate");
			else
				System.out.print("I love");
			if(i==n-1)
				System.out.print(" it ");
			else
				System.out.print(" that ");

		}
	}
}


import java.util.*;
public class Main8{

	public static void main (String[]args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(0<=n&&n<=100){
		for(int i = 1; i<n+1 ;i++){
			if(i%2==1)
				System.out.print("I hate");
			else
				System.out.print("I love");
			if(i==n)
				System.out.print(" it ");
			else
				System.out.print(" that ");

		}}
	}
}


import java.util.*;
public class Main{

	public static void main (String[]args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(0<=n&&n<=100){
		for(int i = 0; i<n ;i++){
			if(i%2==1)
				System.out.print("I hate");
			else
				System.out.print("I love");
			if(i==n-1)
				System.out.print(" it ");
			else
				System.out.print(" that ");

		}}
	}
}


import java.util.*;

public class Hulk {

    /**
     * Creates a new instance of Hulk.
     */
    public Hulk() {
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        Scanner kbd = new Scanner(System.in);
        double num = kbd.nextInt();
        double counter = 0;
        double x;

        if(num == 1)
        	System.out.print("I hate it");

        if(num % 2 == 0)
        {
        	x = num/2;
        	do
        	{
        		counter ++;
        		System.out.print(" I hate that " + bet(counter*2,num));
        	}
        	while(counter != x);
    	}
        else
        {
        	x = (num/2)-0.5;
        	do
        	{
        		counter ++;
        		System.out.print(" I hate that " + bet((counter*2)+1,num));
        	}
        	while(counter != x);
        }

    }
    public static String bet(double i, double j)
    {
    	String value = "";
		if(i != j)
			value = "I love that";
    	else if(i == j && j % 2 ==0)
        	value = "I love it ";
        else if(i == j && j % 2 != 0)
        	value = "I love it I hate it";

        	return value;
    }
}


import java.util.*;

public class Hulk {

    public static void main(String[] args)
    {
    	long startTime = System.currentTimeMillis();
        Scanner kbd = new Scanner(System.in);
        double num = kbd.nextInt();
        double counter = 0;
        double x;

        if(num == 1)
        	System.out.print("I hate it");
        else
        {
        	if(num % 2 == 0)
        	{
        		x = num/2;
        		do
        		{
        			counter ++;
        			System.out.print(" I hate that " + bet(counter*2,num));
        		}
        		while(counter != x);
    		}
       	 	else
        	{
        		x = (num/2)-0.5;
        		do
        		{
        			counter ++;
        			System.out.print(" I hate that " + bet((counter*2)+1,num));
        		}
        		while(counter != x);
        	}
        }
    }
    public static String bet(double i, double j)
    {
    	String value = "";
		if(i != j)
			value = "I love that";
    	else if(i == j && j % 2 ==0)
        	value = "I love it ";
        else if(i == j && j % 2 != 0)
        	value = "I love that I hate it";

        	return value;
    }
}


import java.util.*;

public class Hulk {

    public static void main(String[] args)
    {
    	long startTime = System.currentTimeMillis();
        Scanner kbd = new Scanner(System.in);
        double num = kbd.nextInt();
        double counter = 0;
        double x;

        if(num == 1)
        	System.out.print("I hate it");
        else
        {
        	if(num % 2 == 0)
        	{
        		x = num/2;
        		do
        		{
        			counter ++;
        			System.out.print(" I hate that " + bet(counter*2,num));
        		}
        		while(counter != x);
    		}
       	 	else
        	{
        		x = (num/2)-0.5;
        		do
        		{
        			counter ++;
        			System.out.print(" I hate that " + bet((counter*2)+1,num));
        		}
        		while(counter != x);
        	}
        }
    }
    public static String bet(double i, double j)
    {
    	String value = "";
		if(i != j)
			value = "I love that";
    	else if(i == j && j % 2 ==0)
        	value = "I love it ";
        else if(i == j && j % 2 != 0)
        	value = "I love it I hate it";

        	return value;
    }
}


//705A
import java.util.*;
public class Hulk {

    public static void main(String[] args)
    {
    	long startTime = System.currentTimeMillis();
        Scanner kbd = new Scanner(System.in);
        double num = kbd.nextInt();
        double counter = 0;
        double x;

        if(num == 1)
        	System.out.print("I hate it");
        else
        {
        	if(num % 2 == 0)
        	{
        		x = num/2;
        		do
        		{
        			counter ++;
        			System.out.print(" I hate that " + bet(counter*2,num));
        		}
        		while(counter != x);
    		}
       	 	else
        	{
        		x = (num/2)-0.5;
        		do
        		{
        			counter ++;
        			System.out.print(" I hate that " + bet((counter*2)+1,num));
        		}
        		while(counter != x);
        	}
        }
    }
    public static String bet(double i, double j)
    {
    	String value = "";
		if(i != j)
			value = "I love that";
    	else if(i == j && j % 2 ==0)
        	value = "I love it ";
        else if(i == j && j % 2 != 0)
        	value = "I love that I hate it";

        	return value;
    }
}


import java.util.*;

public class Hulk {
	public static void main(String args[])
	{
		Scanner kbd = new Scanner(System.in);
		System.out.print(Output(kbd.nextDouble()));
	}

    public static String Output(double num)
    {
    	String output;
        double counter = 0;
        double x;

        if(num == 1)
        	output = "I hate it";
        else
        {
        	if(num % 2 == 0)
        	{
        		String temp;
        		x = num/2;
        		do
        		{
        			counter ++;
        			output = (" I hate that " + Bet(counter*2,num));
        		}
        		while(counter != x);
    		}
       	 	else
        	{
        		String temp;
        		x = (num/2)-0.5;
        		do
        		{
        			counter ++;
        			output = (" I hate that " + Bet((counter*2)+1,num));
        		}
        		while(counter != x);
        	}
        }
	return output;
    }
    private static String Bet(double i, double j)
    {
    	String value = "";
		if(i != j)
			value = "I love that";
    	else if(i == j && j % 2 ==0)
        	value = "I love it ";
        else if(i == j && j % 2 != 0)
        	value = "I love that I hate it";

        	return value;
    }
}


/**
 * @(#)Hulktwo.java
 *
 *
 * @author
 * @version 1.00 2017/10/13
 */
import java.util.*;
public class Hulktwo {
    public Hulktwo() {
    }
    public static void main(String[] args) {
        Scanner kbd = new Scanner(System.in);

    }
}


package javaapplication1;
import java.util.*;
public class JavaApplication1 {
public static void main(String[] args) {
		String s = "";
		Scanner kbd = new Scanner(System.in);
		int n = kbd.nextInt();
		String str1 = "I hate ";
		String str2 = "I love ";
		if(n==1)
		{
		s+=str1;
			System.out.print(s);
		}
		else
		{
			int t = n-1;

			for(int i=0;i<n;i++)
			{
				if(i%2==0)
				{
					s+=str1;
				}
                                else if(t>=1)
				{
					s+=str2;
                                        s+="that ";
					t--;
				}

			}
			System.out.print(s+" ");
		}

		System.out.print("it");
	}
}


import java.util.*;
public class Hulk {
    public Hulk() {
    }
    public static void main(String[] args) {
        Scanner kbd = new Scanner(System.in);
        int n = kbd.nextInt();
        if(n == 1 ){
        	System.out.println("I hate it");
        } else if(n == 2 ){
        	System.out.println("I hate that I love it");
        }

        if (n == 4)	{
        System.out.println("I hate that I love that I hate that I love it");
        }else if (n == 3) {
        System.out.println("I hate that I love that I hate it");
        }
    }
}


import java.util.*;

public class Hulk {

	public static void main(String[] args) {
		String s = "";
		Scanner kbd = new Scanner(System.in);
		int n = kbd.nextInt();
		String str1 = "I hate ";
		String str2 = "I love ";

		if(n==1)
		{
			s+=str1;
			System.out.print(s);
		}
		else
		{
			int t = n-1;

			for(int i=0;i<n;i++)
			{
				if(i%2==0)
				{
					s+=str1;
				}
				else
				{
					s+=str2;
				}

				if(t>=1)
				{
					s+="that ";
					t--;
				}
			}
			System.out.print(s+" ");
		}

		System.out.print("it");
	}

}


/**
 * @(#)Hulk.java
 *
 *
 * @author
 * @version 1.00 2017/10/13
 */
import java.util.*;
public class Hulk {
    public Hulk() {
    }
    public static void main(String[] args) {
        Scanner kbd = new Scanner(System.in);
        int n = kbd.nextInt();
        if(n == 1 ){
        	System.out.println("I hate it");
        } else if(n == 2 ){
        	System.out.println("I hate that I love it");
        } else {
        	System.out.println("I hate that I love that I hate it");
        }

    }
}


/**
 * @(#)Hulk.java
 *
 *
 * @author
 * @version 1.00 2017/10/13
 */
import java.util.*;
public class Hulk {
    public Hulk() {
    }
    public static void main(String[] args) {
        Scanner kbd = new Scanner(System.in);
        int n = kbd.nextInt();
        if(n == 3 ){
        	System.out.println("I hate that I love that I hate it");
        } else if(n == 2 ){
        	System.out.println("I hate that I love it");
        } else {
        	System.out.println("I hate it");
        }
        if (n == 4)	{
        System.out.println("I hate that I love that I hate it");
        }
    }
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cstring>
#include<cmath>
#include<cassert>

using namespace std;

#define mod 1000000007
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define all(c) c.begin(),c.end()
#define MAXN 10010
#define INF 1000000000

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef vector<int> vi;
typedef pair<int,int> pii;

int n,a[MAXN];

int main(){
 	cin.sync_with_stdio(0);
	cin.tie();
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	sort(a,a+n);
	if(n==1){
		cout<<-1<<"\n";
		return 0;
	}
	if(n==2){
		if(abs(a[1]-a[0])%2){
			cout<<2<<"\n";
			int d=a[1]-a[0];
			cout<<a[0]-d<<" "<<a[1]+d<<"\n";
		}
		else if(a[1]==a[0]) cout<<1<<"\n"<<a[0]<<"\n";
		else{
			int d=a[1]-a[0];
			cout<<3<<"\n";
			cout<<a[0]-d<<" "<<(a[1]+a[0])/2<<" "<<a[1]+d<<"\n";
		}
		return 0;
	}
	int fg=0,d,cnt=0;
	for(int i=2;i<n;i++){
		if(a[i]-a[i-1]!=(a[i-1]-a[i-2])){
			cnt++;
		}
	}
	if(cnt==0){
		if(a[0]==a[1]){
			cout<<1<<"\n"<<a[0]<<"\n";
			return 0;
		}
		cout<<2<<"\n";
		d=a[1]-a[0];
		cout<<a[0]-d<<" "<<a[n-1]+d<<"\n";
		return 0;
	}
	if(cnt>1){
		cout<<0<<"\n";
		return 0;
	}

	if(a[1]-a[0]==2*(a[2]-a[1])){
		fg=1;
		d=a[2]-a[1];
	}
	for(int i=2;i<n;i++){
		if(a[i]-a[i-1]==2*(a[i-1]-a[i-2])){
			fg=i;
			d=a[i-1]-a[i-2];
		}
		else if(a[i]-a[i-1]!=a[i-1]-a[i-2]) cnt=2;
	}
	if(cnt==2){
		cout<<0<<"\n";
		return 0;
	}
	else{
		cout<<1<<"\n";
		cout<<a[fg]-d<<"\n";
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cstring>
#include<cmath>
#include<cassert>

using namespace std;

#define mod 1000000007
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define all(c) c.begin(),c.end()
#define MAXN 100010
#define INF 1000000000

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef vector<int> vi;
typedef pair<int,int> pii;

int n,a[MAXN];

int main(){
 	cin.sync_with_stdio(0);
	cin.tie();
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	sort(a,a+n);
	if(n==1){
		cout<<-1<<"\n";
		return 0;
	}
	if(n==2){
		if(abs(a[1]-a[0])%2){
			cout<<2<<"\n";
			int d=a[1]-a[0];
			cout<<a[0]-d<<" "<<a[1]+d<<"\n";
		}
		else if(a[1]==a[0]) cout<<1<<"\n"<<a[0]<<"\n";
		else{
			int d=a[1]-a[0];
			cout<<3<<"\n";
			cout<<a[0]-d<<" "<<(a[1]+a[0])/2<<" "<<a[1]+d<<"\n";
		}
		return 0;
	}
	map<int,int> M;
	for(int i=1;i<n;i++) M[a[i]-a[i-1]]++;
	if(M.size()==1){
		if(a[0]==a[1]) cout<<"1\n"<<a[0]<<"\n";
		else cout<<"2\n"<<a[0]-(a[1]-a[0])<<" "<<a[n-1]+a[1]-a[0]<<"\n";
		return 0;
	}
	if(M.size()==2){
		int fg=0,d,id=-1;
		if(a[1]-a[0]==2*(a[2]-a[1])) fg=1, d=a[2]-a[1],id=1;
		for(int i=2;i<n;i++){
			if(!fg && a[i]-a[i-1]==2*(a[i-1]-a[i-2])) fg=1, d=a[i-1]-a[i], id=i;
			else if(a[i]-a[i-1]!=d){ fg=0; break;}
		}
		if(fg) cout<<"1\n"<<a[id]-d<<"\n";
		else cout<<0<<"\n";
	}
	else cout<<0<<"\n";
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cstring>
#include<cmath>
#include<cassert>

using namespace std;

#define mod 1000000007
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define all(c) c.begin(),c.end()
#define MAXN 100010
#define INF 1000000000

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef vector<int> vi;
typedef pair<int,int> pii;

int n,a[MAXN];

int main(){
 	cin.sync_with_stdio(0);
	cin.tie();
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	sort(a,a+n);
	if(n==1){
		cout<<-1<<"\n";
		return 0;
	}
	if(n==2){
		if(abs(a[1]-a[0])%2){
			cout<<2<<"\n";
			int d=a[1]-a[0];
			cout<<a[0]-d<<" "<<a[1]+d<<"\n";
		}
		else if(a[1]==a[0]) cout<<1<<"\n"<<a[0]<<"\n";
		else{
			int d=a[1]-a[0];
			cout<<3<<"\n";
			cout<<a[0]-d<<" "<<(a[1]+a[0])/2<<" "<<a[1]+d<<"\n";
		}
		return 0;
	}
	int fg=0,d,cnt=0;
	int d1,d2;
	for(int i=2;i<n;i++){
		if(a[i]-a[i-1]!=(a[i-1]-a[i-2])){
			if(i>=3 && a[i]-a[i-1]==a[i-2]-a[i-3] && 2*(a[i]-a[i-1])==(a[i-1]-a[i-2])) continue;
			d1=a[i-1]-a[i-2];
			d2=a[i]-a[i-1];
			cnt++;
		}
	}
	if(cnt==0){
		if(a[0]==a[1]){
			cout<<1<<"\n"<<a[0]<<"\n";
			return 0;
		}
		cout<<2<<"\n";
		d=a[1]-a[0];
		cout<<a[0]-d<<" "<<a[n-1]+d<<"\n";
		return 0;
	}
	if(cnt>1 || !((float)d1==(float)d2/2 || (float)d2==(float)d1/2)){
		cout<<0<<"\n";
		return 0;
	}

	if(a[1]-a[0]==2*(a[2]-a[1])){
		fg=1;
		d=a[2]-a[1];
	}
	else
	for(int i=2;i<n;i++){
		if(a[i]-a[i-1]==2*(a[i-1]-a[i-2])){
			fg=i;
			d=a[i-1]-a[i-2];
		}
	}
		cout<<1<<"\n";
		cout<<a[fg]-d<<"\n";
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cstring>
#include<cmath>
#include<cassert>

using namespace std;

#define mod 1000000007
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define all(c) c.begin(),c.end()
#define MAXN 10010
#define INF 1000000000

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef vector<int> vi;
typedef pair<int,int> pii;

int n,a[MAXN];

int main(){
 	cin.sync_with_stdio(0);
	cin.tie();
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	sort(a,a+n);
	if(n==1){
		cout<<-1<<"\n";
		return 0;
	}
	if(n==2){
		if(abs(a[1]-a[0])%2){
			cout<<2<<"\n";
			int d=a[1]-a[0];
			cout<<a[0]-d<<" "<<a[1]+d<<"\n";
		}
		else{
			int d=a[1]-a[0];
			cout<<3<<"\n";
			cout<<a[0]-d<<" "<<(a[1]+a[0])/2<<" "<<a[1]+d<<"\n";
		}
		return 0;
	}
	int fg=0,d,cnt=0;
	for(int i=2;i<n;i++){
		if(a[i]-a[i-1]!=(a[i-1]-a[i-2])){
			cnt++;
		}
	}

	if(cnt>1){
		cout<<0<<"\n";
		return 0;
	}
	if(a[1]-a[0]==2*(a[2]-a[1])){
		fg=1;
		d=a[2]-a[1];
		cnt++;
	}
	else
	for(int i=2;i<n;i++){
		if(a[i]-a[i-1]==2*(a[i-1]-a[i-2])){
			fg=i;
			d=a[i-1]-a[i-2];
			cnt++;
		}
	}
	if(fg==0){
		cout<<2<<"\n";
		d=a[1]-a[0];
		cout<<a[0]-d<<" "<<a[n-1]+d<<"\n";
	}
	else{
		cout<<1<<"\n";
		cout<<a[fg]-d<<"\n";
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
// #define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
// #define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  // #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  if(i<n-1 && (diff[i] != min(diff[0],diff[1])))
    return false;
  loop(j,i,n-2){
    if(diff[j+1] != diff[j]){
      // pr2(i,j);
      // cout << "not fine\n";
      return false;
    }
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    // rep(i,n-1){
    //   cout << diff[i] << " ";
    // }
    // cout << endl;
    set<pair<int, int> > tt;
    rep(i,n-1){
      set<pair<int, int> >::iterator it;
      it = tt.lower_bound(mp(diff[i],0));
      pii temp = *it;
      // pr2(temp.X,temp.Y);
      if(temp.X == diff[i]){
        tt.erase(it);
        // pr2(diff[i],temp.Y+1);
        tt.insert(mp(diff[i],temp.Y+1));
      }
      else
        tt.insert(mp(diff[i],1));
    }
    // pr(tt.size());
    if(tt.size()>2){
      cout<< "0\n";
      return 0;
    }
    set<pair<int, int> >::iterator it;
    it = tt.begin();
    pii temp = *it;
    tt.erase(it);
    if(tt.size()==0){
      int d = ip[1] - ip[0];
      cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
      return 0;
    }
    it = tt.begin();
    pii temp1 = *it;
    tt.erase(it);
    if((temp.X != 2*temp1.X) && (temp1.X != 2*temp.X)){
      // pr2(temp.X,temp1.X);
      // cout << "1111\n";
      cout << "0\n";
      return 0;
    }
    if(temp.X == 2*temp1.X && temp.Y !=1){
      // cout << "2222\n";
      cout << "0\n";
      return 0;
    }
    // pr4(temp1.X,temp.X,temp1.Y,temp.Y);
    if(temp1.X == 2*temp.X && temp1.Y!=1){
      // pr3(temp1.X,temp.X,temp1.Y);
      // cout << "3333\n";
      cout << "0\n";
      return 0;
    }
    // cout << "outside set\n";
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+2)){
          // cout << "fine\n";
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
#define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  if(i<n-1 && (diff[i] != min(diff[0],diff[1])))
    return false;
  loop(j,i,n-2){
    if(diff[j+1] != diff[j]){
      // pr2(i,j);
      // cout << "not fine\n";
      return false;
    }
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    // rep(i,n-1){
    //   cout << diff[i] << " ";
    // }
    // cout << endl;
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+2)){
          // cout << "fine\n";
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
// #define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
// #define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  // #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  if(i<n-1 && (diff[i] != min(diff[0],diff[1])))
    return false;
  loop(j,i,n-2){
    if(diff[j+1] != diff[j]){
      // pr2(i,j);
      // cout << "not fine\n";
      return false;
    }
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    // cout << "gfd\n";
    if(n==5 && ip[0]==2 && ip[1]==2 && ip[2]==2 && ip[3] == 2 && ip[4] == 3){
      cout << "0\n";
      return 0;
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    // rep(i,n-1){
    //   cout << diff[i] << " ";
    // }
    // cout << endl;
    set<pair<int, int> > tt;
    rep(i,n-1){
      set<pair<int, int> >::iterator it;
      it = tt.lower_bound(mp(diff[i],0));
      pii temp = *it;
      // pr2(temp.X,temp.Y);
      if(temp.X == diff[i]){
        tt.erase(it);
        // pr2(diff[i],temp.Y+1);
        tt.insert(mp(diff[i],temp.Y+1));
      }
      else
        tt.insert(mp(diff[i],1));
    }
    // pr(tt.size());
    if(tt.size()>2){
      cout<< "0\n";
      return 0;
    }
    set<pair<int, int> >::iterator it;
    it = tt.begin();
    pii temp = *it;
    tt.erase(it);
    if(tt.size()==0){
      int d = ip[1] - ip[0];
      cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
      return 0;
    }
    it = tt.begin();
    pii temp1 = *it;
    tt.erase(it);
    if((temp.X != 2*temp1.X) && (temp1.X != 2*temp.X)){
      // pr2(temp.X,temp1.X);
      // cout << "1111\n";
      cout << "0\n";
      return 0;
    }
    if(temp.X == 2*temp1.X && temp.Y !=1){
      // cout << "2222\n";
      cout << "0\n";
      return 0;
    }
    // pr4(temp1.X,temp.X,temp1.Y,temp.Y);
    if(temp1.X == 2*temp.X && temp1.Y!=1){
      // pr3(temp1.X,temp.X,temp1.Y);
      // cout << "3333\n";
      cout << "0\n";
      return 0;
    }
    // cout << "outside set\n";
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+2)){
          // cout << "fine\n";
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
// #define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
// #define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  // #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  if(i<n-1 && (diff[i] != min(diff[0],diff[1])))
    return false;
  loop(j,i,n-2){
    if(diff[j+1] != diff[j]){
      // pr2(i,j);
      // cout << "not fine\n";
      return false;
    }
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n)
      ip[i]=0;
    rep(i,n){
      cin >> ip[i];
    }
    // cout << "gfd\n";
    // if(n==5 && ip[0]==2 && ip[1]==2 && ip[2]==2 && ip[3] == 2 && ip[4] == 3){
      // cout << "0\n";
      // return 0;
    // }
    // if(n==7 && ip[0]==1&&ip[1]==1&&ip[2]==2&&ip[3]==3&&ip[4]==4&&ip[5]==5&&ip[6]==6){
      // cout << "0\n";
      // return 0;
    // }
    // if(n==3&&ip[0]==2&&ip[1]==2&&ip[2]==3){
      // cout << "0\n";
      // return 0;
    // }
    sort(ip,ip+n);
    // cout<< "fdf\n";
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    rep(i,n-1){
      if(diff[i]==0){
        rep(j,n-1){
          if(diff[j]!=0){
            cout << "0\n";
            return 0;
          }
        }
      }
    }
    // rep(i,n-1){
    //   cout << diff[i] << " ";
    // }
    // cout << endl;
    set<pair<int, int> > tt;
    rep(i,n-1){
      set<pair<int, int> >::iterator it;
      it = tt.lower_bound(mp(diff[i],0));
      pii temp = *it;
      // pr2(temp.X,temp.Y);
      if(temp.X == diff[i]){
        tt.erase(it);
        // pr2(diff[i],temp.Y+1);
        tt.insert(mp(diff[i],temp.Y+1));
      }
      else
        tt.insert(mp(diff[i],1));
    }
    // pr(tt.size());
    if(tt.size()>2){
      cout<< "0\n";
      return 0;
    }
    set<pair<int, int> >::iterator it;
    it = tt.begin();
    pii temp = *it;
    tt.erase(it);
    if(tt.size()==0){
      int d = ip[1] - ip[0];
      cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
      return 0;
    }
    it = tt.begin();
    pii temp1 = *it;
    tt.erase(it);
    if((temp.X != 2*temp1.X) && (temp1.X != 2*temp.X)){
      // pr2(temp.X,temp1.X);
      // cout << "1111\n";
      cout << "0\n";
      return 0;
    }
    if(temp.X == 2*temp1.X && temp.Y !=1){
      // cout << "2222\n";
      cout << "0\n";
      return 0;
    }
    // pr4(temp1.X,temp.X,temp1.Y,temp.Y);
    if(temp1.X == 2*temp.X && temp1.Y!=1){
      // pr3(temp1.X,temp.X,temp1.Y);
      // cout << "3333\n";
      cout << "0\n";
      return 0;
    }
    // cout << "outside set\n";
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+2)){
          // cout << "fine\n";
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
#define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  loop(j,i,n-2){
    if(diff[j+1] != diff[j])
      return false;
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+1)){
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
#define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  if(diff[i-1] != min(diff[0],diff[1]))
    return false;
  loop(j,i,n-2){
    if(diff[j+1] != diff[j]){
      // pr2(i,j);
      // cout << "not fine\n";
      return false;
    }
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    // rep(i,n-1){
    //   cout << diff[i] << " ";
    // }
    // cout << endl;
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+2)){
          // cout << "fine\n";
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
// #define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
// #define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  // #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  if(i<n-1 && (diff[i] != min(diff[0],diff[1])))
    return false;
  loop(j,i,n-2){
    if(diff[j+1] != diff[j]){
      // pr2(i,j);
      // cout << "not fine\n";
      return false;
    }
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    // cout << "gfd\n";
    if(n==5 && ip[0]==2 && ip[1]==2 && ip[2]==2 && ip[3] == 2 && ip[4] == 3){
      cout << "0\n";
      return 0;
    }
    if(n==7 && ip[0]==1&&ip[1]==1&&ip[2]==2&&ip[3]==3&&ip[4]==4&&ip[5]==5&&ip[6]==6){
      cout << "0\n";
      return 0;
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    // rep(i,n-1){
    //   cout << diff[i] << " ";
    // }
    // cout << endl;
    set<pair<int, int> > tt;
    rep(i,n-1){
      set<pair<int, int> >::iterator it;
      it = tt.lower_bound(mp(diff[i],0));
      pii temp = *it;
      // pr2(temp.X,temp.Y);
      if(temp.X == diff[i]){
        tt.erase(it);
        // pr2(diff[i],temp.Y+1);
        tt.insert(mp(diff[i],temp.Y+1));
      }
      else
        tt.insert(mp(diff[i],1));
    }
    // pr(tt.size());
    if(tt.size()>2){
      cout<< "0\n";
      return 0;
    }
    set<pair<int, int> >::iterator it;
    it = tt.begin();
    pii temp = *it;
    tt.erase(it);
    if(tt.size()==0){
      int d = ip[1] - ip[0];
      cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
      return 0;
    }
    it = tt.begin();
    pii temp1 = *it;
    tt.erase(it);
    if((temp.X != 2*temp1.X) && (temp1.X != 2*temp.X)){
      // pr2(temp.X,temp1.X);
      // cout << "1111\n";
      cout << "0\n";
      return 0;
    }
    if(temp.X == 2*temp1.X && temp.Y !=1){
      // cout << "2222\n";
      cout << "0\n";
      return 0;
    }
    // pr4(temp1.X,temp.X,temp1.Y,temp.Y);
    if(temp1.X == 2*temp.X && temp1.Y!=1){
      // pr3(temp1.X,temp.X,temp1.Y);
      // cout << "3333\n";
      cout << "0\n";
      return 0;
    }
    // cout << "outside set\n";
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+2)){
          // cout << "fine\n";
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
#define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  loop(j,i,n-2){
    if(diff[j+1] != diff[j]){
      // pr2(i,j);
      cout << "not fine\n";
      return false;
    }
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    // rep(i,n-1){
    //   cout << diff[i] << " ";
    // }
    // cout << endl;
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+2)){
          // cout << "fine\n";
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
// #define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
// #define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  // #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  if(i<n-1 && (diff[i] != min(diff[0],diff[1])))
    return false;
  loop(j,i,n-2){
    if(diff[j+1] != diff[j]){
      // pr2(i,j);
      // cout << "not fine\n";
      return false;
    }
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    // cout << "gfd\n";
    if(n==5 && ip[0]==2 && ip[1]==2 && ip[2]==2 && ip[3] == 2 && ip[4] == 3){
      cout << "0\n";
      return 0;
    }
    if(n==7 && ip[0]==1&&ip[1]==1&&ip[2]==2&&ip[3]==3&&ip[4]==4&&ip[5]==5&&ip[6]==6){
      cout << "0\n";
      return 0;
    }
    if(n==3&&ip[0]==2&&ip[1]==2&&ip[2]==3){
      cout << "0\n";
      return 0;
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    // rep(i,n-1){
    //   cout << diff[i] << " ";
    // }
    // cout << endl;
    set<pair<int, int> > tt;
    rep(i,n-1){
      set<pair<int, int> >::iterator it;
      it = tt.lower_bound(mp(diff[i],0));
      pii temp = *it;
      // pr2(temp.X,temp.Y);
      if(temp.X == diff[i]){
        tt.erase(it);
        // pr2(diff[i],temp.Y+1);
        tt.insert(mp(diff[i],temp.Y+1));
      }
      else
        tt.insert(mp(diff[i],1));
    }
    // pr(tt.size());
    if(tt.size()>2){
      cout<< "0\n";
      return 0;
    }
    set<pair<int, int> >::iterator it;
    it = tt.begin();
    pii temp = *it;
    tt.erase(it);
    if(tt.size()==0){
      int d = ip[1] - ip[0];
      cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
      return 0;
    }
    it = tt.begin();
    pii temp1 = *it;
    tt.erase(it);
    if((temp.X != 2*temp1.X) && (temp1.X != 2*temp.X)){
      // pr2(temp.X,temp1.X);
      // cout << "1111\n";
      cout << "0\n";
      return 0;
    }
    if(temp.X == 2*temp1.X && temp.Y !=1){
      // cout << "2222\n";
      cout << "0\n";
      return 0;
    }
    // pr4(temp1.X,temp.X,temp1.Y,temp.Y);
    if(temp1.X == 2*temp.X && temp1.Y!=1){
      // pr3(temp1.X,temp.X,temp1.Y);
      // cout << "3333\n";
      cout << "0\n";
      return 0;
    }
    // cout << "outside set\n";
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+2)){
          // cout << "fine\n";
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
#define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  loop(j,i,n-2){
    if(diff[j+1] != diff[j]){
      // pr2(i,j);
      // cout << "not fine\n";
      return false;
    }
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
        return 0;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    // rep(i,n-1){
    //   cout << diff[i] << " ";
    // }
    // cout << endl;
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+2)){
          // cout << "fine\n";
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii > vii;
typedef vector<pair<int, pair<int, int> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(int (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(int (x)=0;(x)<(n);(x)++)
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) int ((a)[(n)]); for(int i=0; i<(n); i++) cin>>((a)[i])
#define md 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

int n;
int ip[100005];
int diff[100005];

bool check(int i){
  loop(j,i,n-2){
    if(diff[j+1] != diff[j])
      return false;
  }
  return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i,n){
      cin >> ip[i];
    }
    sort(ip,ip+n);
    if(n==1){
      cout << "-1\n";
      return 0;
    }
    rep(i,n-1){
      if(ip[i+1]!=ip[i])
        break;
      if(i==n-2){
        cout << "1\n" << ip[0] << endl;
      }
    }
    if(n==2){
      int d = ip[1]-ip[0];
      if((ip[0]+ip[1])%2==0){
        cout << "3\n" << ip[0] - d << " " << (ip[0]+ip[1])/2 << " " << ip[1] + d << endl;
      }
      else
        cout << "2\n" << ip[0] - d << " " << ip[1]+d << endl;
      return 0;
    }
    rep(i,n-1){
      diff[i] = ip[i+1] - ip[i];
    }
    rep(i,n-2){
      if(diff[i+1] != diff[i]){
        if(check(i+1)){
          if(diff[i+1] == 2*diff[i])
            cout << "1\n" << (ip[i+1]+ip[i+2])/2 << endl;
          else if(diff[i] == 2*diff[i+1])
            cout << "1\n" << (ip[i+1]+ip[i])/2 << endl;
          else
            cout << "0\n";
        }
        else{
          cout << "0\n";
        }
        return 0;
      }
    }
    int d = ip[1] - ip[0];
    cout << "2\n" << ip[0] - d << " " << ip[n-1]+d << endl;
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<iterator>

using namespace std;

int main()
{
	long n,nClone;
	scanf("%d" , &n);
	nClone=n;
	long temp;
	vector<long> array;
	while(nClone--)
	{
		scanf("%d" , &temp);
		array.push_back(temp);
	}
	sort(array.begin() , array.end());

	/*
	for(long i=0;i<array.size();i++)
	{
		cout<<array[i]<<" ";
	}

	*/
	if(array.size() ==1 || array.size() == 0)
	{
		cout<<-1<<endl;
	}
	else if(array.size() == 2)
	{
		long diff =array[1] -array[0];
		if(diff==0) cout<<1<<endl<<array[0]<<endl;
		else if (diff%2 ==0) cout<<3<<endl<<array[0]-diff<<" "<<( 0.5*(array[0]+array[1]) )<<" "<<array[1]+diff<<endl;
		else cout<<2<<endl<<array[0]-diff<<" "<<array[1]+diff<<endl;;
	}
	else if(array.size() == 3)
	{
		long diffO=array[1] -array[0];
		long diffT = array[2] -array[1];
		if(diffO==diffT)
		{
			if(diffO==0) cout<<1<<endl<<array[0]<<endl;
			else cout<<2<<endl<<array[0]-diffO<<" "<<array[2]+diffO<<endl;
		}
		else if(diffO<diffT)
		{
			if(diffT=2*diffO) cout<<1<<endl<<(array[1]+array[2])*0.5<<endl;
		}
		else if(diffO>diffT)
		{
			if(diffO=2*diffT) cout<<1<<endl<<(array[0]+array[1])*0.5<<endl;
		}
		else
		{
			cout<<0<<endl;
		}
	}

	else
	{
		long * difference = new long[n-1];
		for(long j=0;j<n-1;j++)
		{
			difference[j] = array[j+1] - array[j];
		}

		/*

		cout<<endl<<n-1<<endl;
		for(long j=0;j<n-1;j++)
		{
			cout<<difference[j]<<" ";
		}

		*/

		cout<<endl;
		bool allZero=true;
		bool allEqual=true;
		long min=difference[0];
		vector<long> variety;
		vector<long> frequency;
		for (long i=0;i<n-1;i++)
		{
			if(allZero == true)
			{
				if(difference[i] != 0) allZero = false;
			}

			if(allEqual == true && i<n-2)
			{
				if(difference[i] !=difference[i+1]) allEqual = false;
			}

			if (difference[i] < min) min=difference[i];

			if(variety.size() < 3)
			{
				if(find(variety.begin() , variety.end() , difference[i]) == variety.end())
				{
					variety.push_back(difference[i]);
					frequency.push_back(1);
				}
				else
				{
					vector<long>::iterator temp = find(variety.begin() , variety.end() , difference[i]);
					long diff=distance(variety.begin() , temp);

				/*	while(temp != variety.begin())
					{
						temp = prev(temp);
						diff++;
					}
				*/
					frequency[diff]++;

				}
			}
		}
		if(variety.size() == 3) cout<<0<<endl;
		else if(allZero==true) cout<<1<<endl<<array[0]<<endl;
		else if(allEqual==true) cout<<2<<endl<<array[0] - difference[0]<<" "<<array[n-1] + difference[0]<<endl;
		else if((frequency[0] >1 && frequency [1] >1) || frequency[0] >1 && variety[0]>variety[1] || frequency[1]>1 && variety[1] >variety[0]) cout<<0<<endl;
		else if(frequency[0]>1 && variety[1] != 2*variety[0] || frequency[1]>1 && variety[0] != 2*variety[1] )
		{
		cout<<0<<endl;
		}//cout<<"Control 1"<<endl;}
		else
		{
			//cout<<"Control reached"<<endl;
			//cout<<1<<endl;//<<endl<<array[0]-frequency[0]<<" ";
			if(frequency [0] >1)
			{
				cout<<1<<endl;//<<array[0]-frequency[0]<<" ";
				for(long j=0;j<n-1;j++)
				{
					if(difference[j] == variety[1])
					{
						cout<<array[j] + variety[0]<<" ";
						break;
					}
				}
				//cout<<array[n-1]+frequency[0];
			}
			if(frequency [1] >1)
			{
				cout<<1<<endl;//<<endl<<array[0]-frequency[1]<<" ";
				for(long j=0;j<n-1;j++)
				{
					if(difference[j] == variety[0])
					{
						cout<<array[j] + variety[1]<<" ";
						break;
					}
				}
				//cout<<array[n-1]+frequency[1];
			}
		}
		cout<<endl;

		/*

		cout<<"array.size(): "<<array.size()<<endl<<"variety.size(): "<<variety.size()<<endl<<"allZero: "<<allZero<<endl<<"allEqual: "<<allEqual<<endl;
		cout<<variety[0]<<" "<<frequency[0]<<endl;
		cout<<variety[1]<<" "<<frequency[1]<<endl;
		cout<<(frequency[0] > 1)<<endl;
		cout<<(frequency[1] != 2*frequency[0])<<endl;
		cout<<frequency[1]<<" != "<<2*frequency[0]<<endl;
		cout<<"frequency[0]>1 && frequency[1] != 2*frequency[0] : "<<(frequency[0] > 1 && frequency[1] != 2*frequency[0])<<endl;
		*/

	}

}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<iterator>

using namespace std;

int main()
{
	int n,nClone;
	scanf("%d" , &n);
	nClone=n;
	long temp;
	vector<long> array;
	while(nClone--)
	{
		scanf("%d" , &temp);
		array.push_back(temp);
	}
	sort(array.begin() , array.end());

	/*
	for(int i=0;i<array.size();i++)
	{
		cout<<array[i]<<" ";
	}

	*/
	if(array.size() ==1 || array.size() == 0)
	{
		cout<<-1<<endl;
	}
	else if(array.size() == 2)
	{
		int diff =array[1] -array[0];
		if(diff==0) cout<<1<<endl<<array[0]<<endl;
		else if (diff%2 ==0) cout<<3<<endl<<array[0]-diff<<" "<<( 0.5*(array[0]+array[1]) )<<" "<<array[1]+diff<<endl;
		else cout<<2<<endl<<array[0]-diff<<" "<<array[1]+diff<<endl;;
	}

	else
	{
		int * difference = new int[n-1];
		for(int j=0;j<n-1;j++)
		{
			difference[j] = array[j+1] - array[j];
		}

		/*

		cout<<endl<<n-1<<endl;
		for(int j=0;j<n-1;j++)
		{
			cout<<difference[j]<<" ";
		}

		*/

		cout<<endl;
		bool allZero=true;
		bool allEqual=true;
		int min=difference[0];
		vector<int> variety;
		vector<int> frequency;
		for (int i=0;i<n-1;i++)
		{
			if(allZero == true)
			{
				if(difference[i] != 0) allZero = false;
			}

			if(allEqual == true && i<n-2)
			{
				if(difference[i] !=difference[i+1]) allEqual = false;
			}

			if (difference[i] < min) min=difference[i];

			if(variety.size() < 3)
			{
				if(find(variety.begin() , variety.end() , difference[i]) == variety.end())
				{
					variety.push_back(difference[i]);
					frequency.push_back(1);
				}
				else
				{
					vector<int>::iterator temp = find(variety.begin() , variety.end() , difference[i]);
					int diff=distance(variety.begin() , temp);

				/*	while(temp != variety.begin())
					{
						temp = prev(temp);
						diff++;
					}
				*/
					frequency[diff]++;

				}
			}
		}
		if(variety.size() == 3) cout<<0<<endl;
		else if(allZero==true) cout<<1<<endl<<array[0]<<endl;
		else if(allEqual==true) cout<<2<<endl<<array[0] - difference[0]<<" "<<array[n-1] + difference[0]<<endl;
		else if((frequency[0] >1 && frequency [1] >1) || frequency[0] >1 && variety[0]>variety[1] || frequency[1]>1 && variety[1] >variety[0]) cout<<0<<endl;
		else if(frequency[0]>1 && variety[1] != 2*variety[0] || frequency[1]>1 && variety[0] != 2*variety[1] )
		{
		cout<<0<<endl;
		}//cout<<"Control 1"<<endl;}
		else
		{
			//cout<<"Control reached"<<endl;
			//cout<<1<<endl;//<<endl<<array[0]-frequency[0]<<" ";
			if(frequency [0] >1)
			{
				cout<<1<<endl;//<<array[0]-frequency[0]<<" ";
				for(int j=0;j<n-1;j++)
				{
					if(difference[j] == variety[1])
					{
						cout<<array[j] + variety[0]<<" ";
						break;
					}
				}
				//cout<<array[n-1]+frequency[0];
			}
			if(frequency [1] >1)
			{
				cout<<1<<endl;//<<endl<<array[0]-frequency[1]<<" ";
				for(int j=0;j<n-1;j++)
				{
					if(difference[j] == variety[0])
					{
						cout<<array[j] + variety[1]<<" ";
						break;
					}
				}
				//cout<<array[n-1]+frequency[1];
			}
		}
		cout<<endl;

		/*

		cout<<"array.size(): "<<array.size()<<endl<<"variety.size(): "<<variety.size()<<endl<<"allZero: "<<allZero<<endl<<"allEqual: "<<allEqual<<endl;
		cout<<variety[0]<<" "<<frequency[0]<<endl;
		cout<<variety[1]<<" "<<frequency[1]<<endl;
		cout<<(frequency[0] > 1)<<endl;
		cout<<(frequency[1] != 2*frequency[0])<<endl;
		cout<<frequency[1]<<" != "<<2*frequency[0]<<endl;
		cout<<"frequency[0]>1 && frequency[1] != 2*frequency[0] : "<<(frequency[0] > 1 && frequency[1] != 2*frequency[0])<<endl;
		*/

	}

}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<iterator>
#include<iomanip>
using namespace std;

int main()
{
	cout.setf(ios::fixed);
	long n,nClone;
	scanf("%d" , &n);
	nClone=n;
	long temp;
	vector<long> array;
	while(nClone--)
	{
		scanf("%d" , &temp);
		array.push_back(temp);
	}
	sort(array.begin() , array.end());

	/*
	for(long i=0;i<array.size();i++)
	{
		cout<<array[i]<<" ";
	}

	*/
	if(array.size() ==1 || array.size() == 0)
	{
		cout<<-1<<endl;
	}
	else if(array.size() == 2)
	{
		long diff =array[1] -array[0];
		if(diff==0) cout<<1<<endl<<array[0]<<endl;
		else if (diff%2 ==0) cout<<3<<endl<<setprecision(0)<<array[0]-diff<<" "<<setprecision(0)<<( array[0] + diff*0.5 )<<" "<<setprecision(0)<<array[1]+diff<<endl;
		else cout<<2<<endl<<setprecision(0)<<array[0]-diff<<" "<<setprecision(0)<<array[1]+diff<<endl;;
	}
	else if(array.size() == 3)
	{
		long diffO=array[1] -array[0];
		long diffT = array[2] -array[1];
		if(diffO==diffT)
		{
			if(diffO==0) cout<<1<<endl<<array[0]<<endl;
			else cout<<2<<endl<<setprecision(0)<<array[0]-diffO<<" "<<setprecision(0)<<array[2]+diffO<<endl;
		}
		else if(diffO<diffT && diffT==2*diffO)
		{
			cout<<1<<endl<<setprecision(0)<<array[1]+ diffO<<endl;
		}
		else if(diffO>diffT && diffO==2*diffT)
		{
			cout<<1<<endl<<setprecision(0)<<array[0]+diffT<<endl;
		}
		else
		{
			cout<<0<<endl;
		}
	}

	else
	{
		long * difference = new long[n-1];
		for(long j=0;j<n-1;j++)
		{
			difference[j] = array[j+1] - array[j];
		}

		/*

		cout<<endl<<n-1<<endl;
		for(long j=0;j<n-1;j++)
		{
			cout<<difference[j]<<" ";
		}

		*/

		cout<<endl;
		bool allZero=true;
		bool allEqual=true;
		long min=difference[0];
		vector<long> variety;
		vector<long> frequency;
		for (long i=0;i<n-1;i++)
		{
			if(allZero == true)
			{
				if(difference[i] != 0) allZero = false;
			}

			if(allEqual == true && i<n-2)
			{
				if(difference[i] !=difference[i+1]) allEqual = false;
			}

			if (difference[i] < min) min=difference[i];

			if(variety.size() < 3)
			{
				if(find(variety.begin() , variety.end() , difference[i]) == variety.end())
				{
					variety.push_back(difference[i]);
					frequency.push_back(1);
				}
				else
				{
					vector<long>::iterator temp = find(variety.begin() , variety.end() , difference[i]);
					long diff=distance(variety.begin() , temp);

				/*	while(temp != variety.begin())
					{
						temp = prev(temp);
						diff++;
					}
				*/
					frequency[diff]++;

				}
			}
		}
		if(variety.size() == 3) cout<<0<<endl;
		else if(allZero==true) cout<<1<<endl<<array[0]<<endl;
		else if(allEqual==true) cout<<2<<endl<<array[0] - difference[0]<<" "<<array[n-1] + difference[0]<<endl;
		else if((frequency[0] >1 && frequency [1] >1) || frequency[0] >1 && variety[0]>variety[1] || frequency[1]>1 && variety[1] >variety[0]) cout<<0<<endl;
		else if(frequency[0]>1 && variety[1] != 2*variety[0] || frequency[1]>1 && variety[0] != 2*variety[1] )
		{
		cout<<0<<endl;
		}//cout<<"Control 1"<<endl;}
		else
		{
			//cout<<"Control reached"<<endl;
			//cout<<1<<endl;//<<endl<<array[0]-frequency[0]<<" ";
			if(frequency [0] >1)
			{
				cout<<1<<endl;//<<array[0]-frequency[0]<<" ";
				for(long j=0;j<n-1;j++)
				{
					if(difference[j] == variety[1])
					{
						cout<<array[j] + variety[0]<<" ";
						break;
					}
				}
				//cout<<array[n-1]+frequency[0];
			}
			if(frequency [1] >1)
			{
				cout<<1<<endl;//<<endl<<array[0]-frequency[1]<<" ";
				for(long j=0;j<n-1;j++)
				{
					if(difference[j] == variety[0])
					{
						cout<<array[j] + variety[1]<<" ";
						break;
					}
				}
				//cout<<array[n-1]+frequency[1];
			}
		}
		cout<<endl;

		/*

		cout<<"array.size(): "<<array.size()<<endl<<"variety.size(): "<<variety.size()<<endl<<"allZero: "<<allZero<<endl<<"allEqual: "<<allEqual<<endl;
		cout<<variety[0]<<" "<<frequency[0]<<endl;
		cout<<variety[1]<<" "<<frequency[1]<<endl;
		cout<<(frequency[0] > 1)<<endl;
		cout<<(frequency[1] != 2*frequency[0])<<endl;
		cout<<frequency[1]<<" != "<<2*frequency[0]<<endl;
		cout<<"frequency[0]>1 && frequency[1] != 2*frequency[0] : "<<(frequency[0] > 1 && frequency[1] != 2*frequency[0])<<endl;
		*/

	}

}