import java.util.*;

public class ArithmeticProgression382C
{
    public static void main(String[] args)
    {
        // Set up scanner
        Scanner sc = new Scanner(System.in);
        // System.out.println("Enter n");
        int n = sc.nextInt();

        if (n==1)
        {
            System.out.println(-1);
            return;
        }

        int[] a = new int[n];
        for (int i=0; i<n; i++)
        {
            // System.out.println("Enter next number");
            a[i] = sc.nextInt();
        }

        Arrays.sort(a);

        if (n==2)
        {
            int diff = a[1]-a[0];
            if (diff == 0)    // Both the same number
            {
                System.out.println(1);
                System.out.println(a[0]);
                return;
            }
            if (diff % 2 == 0)
            {
                System.out.println(3);
                System.out.print((a[0]-diff) + " ");
                System.out.print(((a[0]+a[1])/2) + " ");
                System.out.println(a[1] + diff);
                return;
            }
            else
            {
                System.out.println(2);
                System.out.print((a[0]-diff) + " ");
                System.out.println(a[1] + diff);
                return;
            }
        }

        if (n==3)
        {
            int diffone = a[1]-a[0];
            int difftwo = a[2]-a[1];
            if (diffone == difftwo)   // An arith progression to start with
            {
                if (diffone == 0)     // All the same number
                {
                   System.out.println(1);
                   System.out.println(a[0]);
                   return;
                }
                else
                {
                    System.out.println(2);
                    System.out.print((a[0]-diffone) + " ");
                    System.out.println(a[2] + diffone);
                    return;
                }
            }
            else     // One difference must be half the other for one
            {
                if (diffone * 2 == difftwo)
                {
                    System.out.println(1);
                    System.out.println((a[1] + a[2])/2);
                    return;
                }
                else if (difftwo * 2 == diffone)
                {
                    System.out.println(1);
                    System.out.println((a[0] + a[1])/2);
                    return;
                }
                else
                {
                    System.out.println(0);
                    return;
                }
            }
        }
        // General case--all gaps must be equal except one twice the size of all others
        // Try two loops first, as that is the easiest to code up
        Set<Integer> gaps = new HashSet<Integer>();
        for (int i=0; i<n-1; i++)
        {
            gaps.add(a[i+1]-a[i]);
        }

        if (gaps.size() > 2)    // More than 2 gaps--can't do it
        {
            System.out.println(0);
            return;
        }
        if (gaps.size() == 1)  // All the same gap--either 1 or 2
        {
            int diff = a[1]-a[0];
            if (diff == 0)   //  All numbers the same
            {
                System.out.println(1);
                System.out.println(a[0]);
                return;
            }
            else       // Already an arithmetic sequence--can add at each end
            {
                System.out.println(2);
                System.out.print((a[0]-diff) + " ");
                System.out.println(a[n-1]+diff);
                return;
            }
        }

        // The hard case--exactly two unequal gap sizes
        int j=0;
        int gapone=-1;
        int gaptwo=-1;
        // System.out.println("In the two unequal gap size case");
        for (Integer x: gaps)
        {
            if (j==0)
            {
                gapone = x;
            }
            else
            {
                gaptwo = x;
            }
            j++;
        }
        int biggap = Math.max(gapone, gaptwo);
        int smallgap = Math.min(gapone, gaptwo);
        // System.out.println("The gaps are " + smallgap + " and " + biggap);
        if (smallgap * 2 != biggap)    // Big one must be twice the small one
        {
            System.out.println(0);
            return;
        }
        // Find out which one occurs only once--THE BIG ONE MUST BE THE SINGLETON
        int biggapcount = 0;
        int smallgapcount = 0;
        int one = a[1] - a[0];
        if (one == biggap)
        {
            biggapcount++;
        }
        else
        {
            smallgapcount++;
        }
        int two = a[2] - a[1];
        if (two == biggap)
        {
            biggapcount++;
        }
        else
        {
            smallgapcount++;
        }
        int three = a[3] - a[2];
        if (three == biggap)
        {
            biggapcount++;
        }
        else
        {
            smallgapcount++;
        }

        if (biggapcount > 1)
        {
            System.out.println(0);
            return;
        }

        // If we get here, the bigger gap only occured once

        // OOPS--We don't know it's a singleton here!
        // Need to see if it occurs multiple times

        // Find where it is and fill it in
        // System.out.println("The singleton bigger gap is " + biggap);
        int thebiggapcount = 0;
        int answerifpossible = -1;
        for (int i=0; i<n-1; i++)
        {
            if (a[i+1] - a[i] == biggap)
            {
                answerifpossible = (a[i+1] + a[i])/2;
                thebiggapcount++;
            }
        }
        if (thebiggapcount > 1)
        {
            System.out.println(0);
            return;
        }
        else
        {
            System.out.println(1);
            System.out.println(answerifpossible);
        }
    }
}


import java.util.*;
import java.io.*;

public class TaskC {
    private FastScanner in;
    private PrintWriter out;

    public void solve() throws IOException {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        Arrays.sort(a);
        List<Integer> result = new ArrayList<Integer>();
        if (n > 2) {
            Map<Integer, Integer> diff = new HashMap<Integer, Integer>();

            for (int i = 0; i < n - 1; i++) {
                diff.put(a[i + 1] - a[i], diff.containsKey(a[i + 1] - a[i]) ? diff.get(a[i + 1] - a[i]) + 1 : 1);
            }
            if (diff.size() == 1) {
                int curDiff = diff.keySet().iterator().next();
                result.add(a[0] - curDiff);
                result.add(a[n - 1] + curDiff);
            }

            if (diff.size() == 2) {
                int[] diffs = new int[2];
                int cnt = 0;
                for (Iterator<Integer> it = diff.keySet().iterator(); it.hasNext();) {
                    diffs[cnt++] = it.next();
                }
                Arrays.sort(diffs);
                if (diff.get(diffs[1]) == 1 && diffs[1]  == 2 * diffs[0]) {
                    for (int i = 0; i < n - 1; i++) {
                        if (a[i + 1] - a[i] == diffs[1]) {
                            result.add(a[i] + diffs[0]);
                            break;
                        }
                    }
                }

            }

        } else {
            if (n == 1) {
                out.print(-1);
                return;
            } else {
                int diff = a[1] - a[0];
                result.add(a[0] - diff);
                result.add(a[1] + diff);
                if (diff % 2 == 0) {
                    result.add((a[0] + a[1]) / 2);
                }
            }
        }
        Collections.sort(result);
        out.println(result.size());
        for (int cur : result) {
            out.print(cur + " ");
        }

    }

    public void run() {
        try {
            in = new FastScanner();
            out = new PrintWriter(System.out);
            solve();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private class FastScanner {
        private BufferedReader br;
        private StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }

    public static void main(String[] arg) {
        new TaskC().run();
    }
}


import java.util.*;
import java.io.*;

public class TaskC {
    private FastScanner in;
    private PrintWriter out;

    public void solve() throws IOException {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        Arrays.sort(a);
        Set<Integer> result = new TreeSet<Integer>();
        if (n > 2) {
            Map<Integer, Integer> diff = new HashMap<Integer, Integer>();

            for (int i = 0; i < n - 1; i++) {
                diff.put(a[i + 1] - a[i], diff.containsKey(a[i + 1] - a[i]) ? diff.get(a[i + 1] - a[i]) + 1 : 1);
            }
            if (diff.size() == 1) {
                int curDiff = diff.keySet().iterator().next();
                result.add(a[0] - curDiff);
                result.add(a[n - 1] + curDiff);
            }

            if (diff.size() == 2) {
                int[] diffs = new int[2];
                int cnt = 0;
                for (Iterator<Integer> it = diff.keySet().iterator(); it.hasNext();) {
                    diffs[cnt++] = it.next();
                }
                Arrays.sort(diffs);
                if (diff.get(diffs[1]) == 1 && diffs[1]  == 2 * diffs[0]) {
                    for (int i = 0; i < n - 1; i++) {
                        if (a[i + 1] - a[i] == diffs[1]) {
                            result.add(a[i] + diffs[0]);
                            break;
                        }
                    }
                }

            }

        } else {
            if (n == 1) {
                out.print(-1);
                return;
            } else {
                int diff = a[1] - a[0];
                result.add(a[0] - diff);
                result.add(a[1] + diff);
                if (diff % 2 == 0) {
                    result.add((a[0] + a[1]) / 2);
                }
            }
        }
        out.println(result.size());
        for (int cur : result) {
            out.print(cur + " ");
        }

    }

    public void run() {
        try {
            in = new FastScanner();
            out = new PrintWriter(System.out);
            solve();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private class FastScanner {
        private BufferedReader br;
        private StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }

    public static void main(String[] arg) {
        new TaskC().run();
    }
}


var n = +readline();
var num = readline().split(' ').map(function(v){
	return +v;
});

var _flg=false;
num.sort(function(a,b){
	if(a==b){
		_flg=true;
		return 0;
	}else if(a>b){
		return 1;
	}else{
		return -1;
	}
});
if(n==1){
	print(-1);
}else if(_flg){
	print(0);
}else{

var arr = [];
for(var i=1;i<n;i++){
	arr.push( num[i]-num[i-1] );
}
var gcd=function(a,b){
	while(b!=0){
		var r=b;
		b=a%b;
		a=r;
	}
	return a;
};
var g=arr[0];
for(var i=1;i<arr.length;i++){
	g = gcd(g, arr[i]);
}

var ret=[];
for(var i=0;i<n-1;i++){

	var v = num[i]+g;
	while(v!==num[i+1]){
		ret.push(v);
		v=v+g;
	}
}

if(ret.length==0){
	print(2);
	print([num[0]-g, num[n-1]+g].join(' '));
}else{
	print(ret.length);
	print(ret.join(' '));
}

}


var n = +readline();
var a = readline().split(' ').map(function(v){
	return +v;
});

a.sort(function(a,b){ return a===b?0:a>b?1:-1; });

if(n===1){
	print(-1);
}else{
	var k = {};
	for(var i=1; i<n; i++){
		k[a[i]-a[i-1]]=true;
	}
	k=Object.keys(k).map(function(v){return +v;});
	if(k.length===1){
		if(k[0]===0){
			print(1);
			print(a[0]);
		}else{
			if( a.length==2 && (a[1]-a[0])%2==0 ){
				print(3);
				print([a[0]-k[0], a[0]+(a[1]-a[0])/2, a[n-1]+k[0]].join(' '));
			}else{
				print(2);
				print([a[0]-k[0], a[n-1]+k[0]].join(' '));
			}
		}
	}else if(k.length===2){
		var k0 = Math.min(k[0], k[1]);
		var k1 = Math.max(k[0], k[1]);
		if(k0*2==k1){
			var f=false;
			var e=false;
			var ans;
			for(var i=0; i<n-1; i++){
				if(a[i]+k0!==a[i+1]){
					if(!f){
						f=true;
						ans=a[i]+k0;
					}else{
						e=true;
					}
				}
			}
			if(e){
				print(0);
			}else{
				print(1);
				print(ans);
			}
		}else{
			print(0);
		}
	}else{
		print(0);
	}
}


var n = +readline();
var a = readline().split(' ').map(function(v){
	return +v;
});

a.sort(function(a,b){ return a===b?0:a>b?1:-1; });

if(n===1){
	print(-1);
}else{
	var k = {};
	for(var i=1; i<n; i++){
		k[a[i]-a[i-1]]=true;
	}
	k=Object.keys(k).map(function(v){return +v;});
	if(k.length===1){
		if(k[0]===0){
			print(1);
			print(a[0]);
		}else{
			if( a.length==2 && (a[1]-a[0])%2==0 ){
				print(2);
				print([a[0]-k[0], a[0]+(a[1]-a[0])/2, a[n-1]+k[0]].join(' '));
			}else{
				print(2);
				print([a[0]-k[0], a[n-1]+k[0]].join(' '));
			}
		}
	}else if(k.length===2){
		var k0 = Math.min(k[0], k[1]);
		var k1 = Math.max(k[0], k[1]);
		if(k0*2==k1){
			var f=false;
			var e=false;
			var ans;
			for(var i=0; i<n-1; i++){
				if(a[i]+k0!==a[i+1]){
					if(!f){
						f=true;
						ans=a[i]+k0;
					}else{
						e=true;
					}
				}
			}
			if(e){
				print(-1);
			}else{
				print(1);
				print(ans);
			}
		}else{
			print(-1);
		}
	}else{
		print(-1);
	}
}


var n = +readline();
var num = readline().split(' ').map(function(v){
	return +v;
});

var _flg=1;
num.sort(function(a,b){
	if(a==b){
		_flg++;
		return 0;
	}else if(a>b){
		return 1;
	}else{
		return -1;
	}
});
if(n==1){
	print(-1);
}else if(_flg>1){
	if(num.length==_flg){
		print(1);
		print(num[0]);
	}else{
		print(0);
	}
}else{

var arr = [];
for(var i=1;i<n;i++){
	arr.push( num[i]-num[i-1] );
}
var gcd=function(a,b){
	while(b!=0){
		var r=b;
		b=a%b;
		a=r;
	}
	return a;
};

var map={};
arr.forEach(function(v){
	map[v]=true;
});

var k = Object.keys(map);
if( k.length>2 ){
	print(0);
}else if(k.length===2){
	if(k[0]*2==k[1]||k[1]*2==k[0]){
		var ret=[];
		var g = Math.min(+k[0], +k[1]);
		for(var i=0;i<n-1;i++){

			var v = num[i]+g;
			while(v!==num[i+1]){
				ret.push(v);
				v=v+g;
			}
		}
		print(ret.length);
		print(ret.join(' '));
	}else{
		print(0);
	}
}else{
	if(n==2&& (num[1]-num[0])%2==0 ){
		print(3);
		print([num[0]-k[0], num[0]+(num[1]-num[0])/2,num[1]+ +k[0]].join(' '));
	}else{
		print(2);
		print([num[0]-k[0], num[n-1]+ +k[0]].join(' '));
	}
}

}


var n = +readline();
var num = readline().split(' ').map(function(v){
	return +v;
});

var _flg=false;
num.sort(function(a,b){
	if(a==b){
		_flg=true;
		return 0;
	}else if(a>b){
		return 1;
	}else{
		return -1;
	}
});
if(n==1){
	print(-1);
}else if(_flg){
	if(num.length==2){
		print(1);
		print(num[0]);
	}else{
		print(0);
	}
}else{

var arr = [];
for(var i=1;i<n;i++){
	arr.push( num[i]-num[i-1] );
}
var gcd=function(a,b){
	while(b!=0){
		var r=b;
		b=a%b;
		a=r;
	}
	return a;
};

var map={};
arr.forEach(function(v){
	map[v]=true;
});

var k = Object.keys(map);
if( k.length>2 ){
	print(0);
}else if(k.length===2){
	if(k[0]*2==k[1]||k[1]*2==k[0]){
		var ret=[];
		var g = Math.min(+k[0], +k[1]);
		for(var i=0;i<n-1;i++){

			var v = num[i]+g;
			while(v!==num[i+1]){
				ret.push(v);
				v=v+g;
			}
		}
		print(ret.length);
		print(ret.join(' '));
	}else{
		print(0);
	}
}else{
	if(n==2&& (num[1]-num[0])%2==0 ){
		print(3);
		print([num[0]-k[0], num[0]+(num[1]-num[0])/2,num[1]+ +k[0]].join(' '));
	}else{
		print(2);
		print([num[0]-k[0], num[n-1]+ +k[0]].join(' '));
	}
}

}


var n = +readline();
var a = readline().split(' ').map(function(v){
	return +v;
});

a.sort(function(a,b){ return a===b?0:a>b?1:-1; });

if(n===1){
	print(-1);
}else{
	var k = {};
	for(var i=1; i<n; i++){
		k[a[i]-a[i-1]]=true;
	}
	k=Object.keys(k).map(function(v){return +v;});
	if(k.length===1){
		if(k[0]===0){
			print(1);
			print(a[0]);
		}else{
			if( a.length==2 && (a[1]-a[0])%2==0 ){
				print(2);
				print([a[0]-k[0], a[0]+(a[1]-a[0])/2, a[n-1]+k[0]].join(' '));
			}else{
				print(2);
				print([a[0]-k[0], a[n-1]+k[0]].join(' '));
			}
		}
	}else if(k.length===2){
		var k0 = Math.min(k[0], k[1]);
		var k1 = Math.max(k[0], k[1]);
		if(k0*2==k1){
			var f=false;
			var e=false;
			var ans;
			for(var i=0; i<n-1; i++){
				if(a[i]+k0!==a[i+1]){
					if(!f){
						f=true;
						ans=a[i]+k0;
					}else{
						e=true;
					}
				}
			}
			if(e){
				print(0);
			}else{
				print(1);
				print(ans);
			}
		}else{
			print(0);
		}
	}else{
		print(0);
	}
}


var n = +readline();
var num = readline().split(' ').map(function(v){
	return +v;
});

var _flg=false;
num.sort(function(a,b){
	if(a==b){
		_flg=true;
		return 0;
	}else if(a>b){
		return 1;
	}else{
		return -1;
	}
});
if(n==1){
	print(-1);
}else if(_flg){
	print(0);
}else{

var arr = [];
for(var i=1;i<n;i++){
	arr.push( num[i]-num[i-1] );
}
var gcd=function(a,b){
	while(b!=0){
		var r=b;
		b=a%b;
		a=r;
	}
	return a;
};
var g=arr[0];
for(var i=1;i<arr.length;i++){
	g = gcd(g, arr[i]);
}

var ret=[];
for(var i=0;i<n-1;i++){

	var v = num[i]+g;
	while(v!==num[i+1]){
		ret.push(v);
		v=v+g;
	}
}

print(ret.length);
print(ret.join(' '));

}


var n = +readline();
var num = readline().split(' ').map(function(v){
	return +v;
});

var _flg=false;
num.sort(function(a,b){
	if(a==b){
		_flg=true;
		return 0;
	}else if(a>b){
		return 1;
	}else{
		return -1;
	}
});
if(n==1){
	print(-1);
}else if(_flg){
	print(0);
}else{

var arr = [];
for(var i=1;i<n;i++){
	arr.push( num[i]-num[i-1] );
}
var gcd=function(a,b){
	while(b!=0){
		var r=b;
		b=a%b;
		a=r;
	}
	return a;
};

var map={};
arr.forEach(function(v){
	map[v]=true;
});

var k = Object.keys(map);
if( k.length>2 ){
	print(0);
}else if(k.length===2){
	if(k[0]*2==k[1]||k[1]*2==k[0]){
		var ret=[];
		var g = Math.min(+k[0], +k[1]);
		for(var i=0;i<n-1;i++){

			var v = num[i]+g;
			while(v!==num[i+1]){
				ret.push(v);
				v=v+g;
			}
		}
		print(ret.length);
		print(ret.join(' '));
	}else{
		print(0);
	}
}else{
	if(n==2&& (num[1]-num[0])%2==0 ){
		print(3);

		print([num[0]-k[0], num[0]+(num[1]-num[0])/2,num[1]+ +k[0]].join(' '));
	}else{
		print(2);
		print([num[0]-k[0], num[n-1]+ +k[0]].join(' '));
	}
}

}


function main()
{
    var N = parseInt( readline() );
    var numbers = readline().split(' ').map( function(item, index, array){ return parseInt(item); } );
    numbers.sort( function(a, b) { return a - b; } );

    if ( N == 1 )
    {
        print(-1);
    }
    else if ( N == 2 )
    {
        if ( numbers[0] == numbers[1] )
        {
            print(1);
            print( numbers[0] );
        }
        else
        {
            var ans = [];
            var diff = numbers[1] - numbers[0];
            ans.push( numbers[0] - diff );
            if ( diff % 2 == 0 ) ans.push( (numbers[0] + numbers[1]) / 2 );
            ans.push( numbers[1] + diff );
            print( ans.length );
            print( ans.join(' ') );
        }
    }
    else
    {
        var gaps = [];
        for (var i = 1; i < N; i++) gaps.push( numbers[i] - numbers[i-1] );
        gaps.sort(function(a, b){ return a - b; });
        gaps = gaps.filter( function(item, index, array){ return (index==0 || item != array[index-1]); } );

        var ans = [];
        if ( gaps.length == 1 )
        {
            ans.push( numbers[0] - gaps[0] );
            if ( gaps[0] != 0 ) ans.push( numbers[numbers.length - 1] + gaps[0] )
        }
        else if ( gaps.length == 2 && 2*gaps[0] == gaps[1] )
        {
            var Count = 0;
            for (var i = 1; i < N; i++) if( numbers[i] - numbers[i-1] == gaps[1] )
            {
                ans.push( (numbers[i] + numbers[i-1]) / 2 );
            }
            if ( ans.length > 1 ) ans = [];
        }

        print( ans.length );
        print( ans.join(' ') );
    }
}

main();


function main()
{
    var N = parseInt( readline() );
    var numbers = readline().split(' ').map( function(item, index, array){ return parseInt(item); } );
    numbers.sort( function(a, b) { return a - b; } );

    if ( N == 1 )
    {
        print(-1);
    }
    else if ( N == 2 )
    {
        if ( numbers[0] == numbers[1] )
        {
            print(1);
            print( numbers[0] );
        }
        else
        {
            var ans = [];
            var diff = numbers[1] - numbers[0];
            ans.push( numbers[0] - diff );
            if ( diff % 2 == 0 ) ans.push( (numbers[0] + numbers[1]) / 2 );
            ans.push( numbers[1] + diff );
            print( ans.length );
            print( ans.join(' ') );
        }
    }
    else
    {
        var gaps = [];
        for (var i = 1; i < N; i++) gaps.push( numbers[i] - numbers[i-1] );
        gaps.sort(function(a, b){ return a - b; });
        gaps = gaps.filter( function(item, index, array){ return (index==0 || item != array[index-1]); } );

        var ans = [];
        if ( gaps.length == 1 )
        {
            ans.push( numbers[0] - gaps[0] );
            ans.push( numbers[numbers.length - 1] + gaps[0] )
        }
        else if ( gaps.length == 2 && 2*gaps[0] == gaps[1] )
        {
            var Count = 0;
            for (var i = 1; i < N; i++) if( numbers[i] - numbers[i-1] == gaps[1] )
            {
                ans.push( (numbers[i] + numbers[i-1]) / 2 );
            }
            if ( ans.length > 1 ) ans = [];
        }

        print( ans.length );
        print( ans.join(' ') );
    }
}

main();


function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function main() {
	var integers = tokenizeIntegers(readline());
	var cardNum = integers[0];
	var cards = tokenizeIntegers(readline());
	cards.sort(function(a, b) { return a-b; });

	if (cardNum == 1) {
		print(-1);
	}
	else if (cardNum == 2) {
		var a = cards[0], b = cards[1];
		if (a == b) {
			print(1);
			print(a);
		}
		else if ((b-a)%2 == 1) {
			print(2);
			print(a-(b-a), b+(b-a));
		}
		else {
			print(3);
			print(a-(b-a), (a+b)/2, b+(b-a));
		}
	}
	else {
		var gaps = [];
		for (var i = 1; i < cardNum; i += 1) {
			gaps.push(cards[i]-cards[i-1]);
		}

		gaps.sort(function(a, b) { return a-b; });
		var small = gaps[0], big = gaps[gaps.length-1];

		if (small == big) {
			if (small == 0) {
				print(1);
				print(cards[0]);
			}
			else {
				print(2);
				print(cards[0]-small, cards[cardNum-1]+small);
			}
		}
		else {
			if (gaps[gaps.length-2] != small) {
				print(0);
				return;
			}
			for (var i = 1; i < cardNum; i += 1) {
				if (cards[i]-cards[i-1] == big) {
					print(1);
					print(cards[i-1]+small);
					return;
				}
			}
		}
	}

}

main();


function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function main() {
	var integers = tokenizeIntegers(readline());
	var cardNum = integers[0];
	var cards = tokenizeIntegers(readline());
	cards.sort(function(a, b) { return a-b; });

	if (cardNum == 1) {
		print(-1);
	}
	else if (cardNum == 2) {
		var a = cards[0], b = cards[1];
		if (a == b) {
			print(1);
			print(a);
		}
		else if ((b-a)%2 == 1) {
			print(2);
			print(a-(b-a), b+(b-a));
		}
		else {
			print(3);
			print(a-(b-a), (a+b)/2, b+(b-a));
		}
	}
	else {
		var gaps = [];
		for (var i = 1; i < cardNum; i += 1) {
			gaps.push(cards[i]-cards[i-1]);
		}

		gaps.sort(function(a, b) { return a-b; });
		var small = gaps[0], big = gaps[gaps.length-1];

		if (small == big) {
			if (small == 0) {
				print(1);
				print(cards[0]);
			}
			else {
				print(2);
				print(cards[0]-small, cards[cardNum-1]+small);
			}
		}
		else {
			if (gaps[gaps.length-2] != small) {
				print(0);
				return;
			}
			if (2*small != big) {
				print(0);
			}
			for (var i = 1; i < cardNum; i += 1) {
				if (cards[i]-cards[i-1] == big) {
					print(1);
					print(cards[i-1]+small);
					return;
				}
			}
		}
	}

}

main();


function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function main() {
	var integers = tokenizeIntegers(readline());
	var cardNum = integers[0];
	var cards = tokenizeIntegers(readline());
	cards.sort(function(a, b) { return a-b; });

	if (cardNum == 1) {
		print(-1);
	}
	else if (cardNum == 2) {
		var a = cards[0], b = cards[1];
		if (a == b) {
			print(1);
			print(a);
		}
		else if ((b-a)%2 == 1) {
			print(2);
			print(a-(b-a), b+(b-a));
		}
		else {
			print(3);
			print(a-(b-a), (a+b)/2, b+(b-a));
		}
	}
	else {
		var gaps = [];
		for (var i = 1; i < cardNum; i += 1) {
			gaps.push(cards[i]-cards[i-1]);
		}

		gaps.sort(function(a, b) { return a-b; });
		var small = gaps[0], big = gaps[gaps.length-1];

		if (small == big) {
			if (small == 0) {
				print(1);
				print(cards[0]);
			}
			else {
				print(2);
				print(cards[0]-small, cards[cardNum-1]+small);
			}
		}
		else {
			if (gaps[gaps.length-2] != small) {
				print(0);
				return;
			}
			if (2*small != big) {
				print(0);
				return;
			}
			for (var i = 1; i < cardNum; i += 1) {
				if (cards[i]-cards[i-1] == big) {
					print(1);
					print(cards[i-1]+small);
					return;
				}
			}
		}
	}

}

main();


#include <bits/stdc++.h>

#define LL long long

using namespace std;

const int MX = 1e3 + 3;
struct VECTOR{
	LL x ,y;
	VECTOR(LL X = 0 ,LL Y = 0){x = X ,y = Y;}
}P[MX];

LL p(LL x){return x * x;}
LL dist(VECTOR a ,VECTOR b){
	return p(a.x - b.x) + p(a.y - b.y);
}

int fa[MX];
void init(){
	for(int i = 0 ; i < MX ; ++i) fa[i] = i;
}
int find(int x){return fa[x] == x ? x : fa[x] = find(fa[x]);}

map<LL ,int> las;
int color[MX];
int cnt[2][2];

int main(){
	init();
	int n; cin >> n;
	for(int i = 1 ; i <= n ; ++i){
		cin >> P[i].x >> P[i].y;
	}
	while(true){
		memset(cnt ,0 ,sizeof cnt);
		for(int i = 1 ; i <= n ; ++i){
			cnt[P[i].x & 1][P[i].y & 1]++;
		}
		int in = 0;
		for(int i = 0 ; i < 2 ; ++i){
			for(int j = 0 ; j < 2 ; ++j){
				in = in || cnt[i][j] == n;
			}
		}
		if(!in) break;
		for(int i = 1 ; i <= n ; ++i){
			P[i].x >>= 1;
			P[i].y >>= 1;
		}
	}
	int even = 0 ,odd = 0;
	for(int i = 1 ; i <= n ; ++i){
		if((P[i].x + P[i].y) % 2 == 0){
			++even;
		}
		else{
			++odd;
		}
	}
	if(even && odd){
		cout << even << endl;
		for(int i = 1 ; i <= n ; ++i){
			if((P[i].x + P[i].y) % 2 == 0){
				cout << i << " ";
			}
		}
		cout << endl;
	}
	else{
		memset(cnt ,0 ,sizeof cnt);
		for(int i = 1 ; i <= n ; ++i){
			cnt[P[i].x & 1][P[i].y & 1]++;
		}
		int A = 0 ,B = 0;
		for( ; A < 2 ; ++A){
			for( ; B < 2 ; ++B){
				if(cnt[A][B]){
					goto outside;
				}
			}
		}
		outside:
		cout << cnt[A][B] << endl;
		for(int i = 1 ; i <= n ; ++i){
			if((P[i].x & 1) == A && (P[i].y & 1) == B){
				cout << i << " ";
			}
		}
		cout << endl;
	}
	return 0;
}


#include <bits/stdc++.h>

#define LL long long

using namespace std;

const int MX = 1e3 + 3;
struct VECTOR{
	LL x ,y;
	VECTOR(LL X = 0 ,LL Y = 0){x = X ,y = Y;}
}P[MX];

LL p(LL x){return x * x;}
LL dist(VECTOR a ,VECTOR b){
	return p(a.x - b.x) + p(a.y - b.y);
}

int fa[MX];
void init(){
	for(int i = 0 ; i < MX ; ++i) fa[i] = i;
}
int find(int x){return fa[x] == x ? x : fa[x] = find(fa[x]);}

map<LL ,int> las;
int color[MX];

int main(){
	init();
	int n; cin >> n;
	for(int i = 1 ; i <= n ; ++i){
		cin >> P[i].x >> P[i].y;
	}
	for(int i = 1 ; i <= n ; ++i){
		las.clear();
		for(int j = 1 ; j <= n ; ++j){
			if(i == j) continue;
			LL d = dist(P[i] ,P[j]);
			if(las.find(d) != las.end()){
				fa[find(j)] = fa[find(las[d])];
			}
			las[d] = j;
		}
	}

	memset(color ,-1 ,sizeof color);
	int cnt = 0 ,c = 0;
	for(int i = 1 ; i <= n ; ++i){
		if(color[find(i)] == -1){
			color[find(i)] = (c ^= 1);
			if(c == 1) ++cnt;
		}
		else{
			if(color[find(i)] == 1) ++cnt;
		}
	}
	cout << cnt << endl;
	for(int i = 1 ; i <= n ; ++i){
		if(color[find(i)] == 1){
			cout << i << " ";
		}
	}
	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
#define foi(i,k,n) for(int i = (int)k; i < (int)n; ++i)
#define x first
#define y second
using namespace std;
using ll = long long;
using ii = pair<int,int>;
constexpr int MAXN = 5 + 1000;

int n;
ii arr[MAXN];
vector<int> od, ev;

ll dist(ii p1, ii p2) {
  ll dx = p1.x - p2.x, dy = p1.y - p2.y;
  return dx * dx + dy * dy;
}

bool ok(const vector<int>& v) {
  vector<bool> l(n, false);
  for (int x : v) l[x] = true;
  set<ll> same, dif;
  foi (i,0,n) {
    foi (j,1+i,n) {
      if (l[i] == l[j]) {
        same.insert(dist(arr[i], arr[j]));
      } else {
        dif.insert(dist(arr[i], arr[j]));
      }
    }
  }
  for (auto p : same) {
    if (dif.find(p) != dif.end()) return false;
  }
  return true;
}

vector<int> solve() {
  vector<int> v1, v2;
  foi (i,0,n) {
    if ((arr[i].x % 2) == 0 && (arr[i].y % 2) == 0) {
      v1.push_back(i);
    } else {
      v2.push_back(i);
    }
  }
  if (v1.size() > 0 && v2.size() > 0) { // hay {par, par} e {impar, impar}.
    return v1;
  } else if (v1.size() > 0) { // solo {par, par}.
    foi (i,0,n) arr[i].x /= 2, arr[i].y /= 2;
    return solve();
  } else { // solo {impar, impar}.
    foi (i,0,n) arr[i].x++, arr[i].y++;
    return solve();
  }
}

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  cin >> n;
  foi (i,0,n) {
    cin >> arr[i].x >> arr[i].y;
    if (((arr[i].x + arr[i].y) % 2) == 0) ev.push_back(i);
    else od.push_back(i);
  }

  vector<int> ans;
  if (ev.size() > 0 && (int) ev.size() < n) { // hay pares e impares.
    ans = ev;
  } else if (ev.size() > 0) { // solo pares.
    ans = solve();
  } else { // solo impares.
    foi (i,0,n) arr[i].y++;
    ans = solve();
  }

  cout << ans.size() << '\n';
  for (int x : ans) cout << 1 + x << ' ';
  cout << '\n';

  assert(ok(ans));
  assert(ans.size() > 0 && (int) ans.size() < n);
  return 0;
}


#include <bits/stdc++.h>
#define foi(i,k,n) for(int i = (int)k; i < (int)n; ++i)
#define x first
#define y second
using namespace std;
using ll = long long;
using ii = pair<int,int>;
constexpr int MAXN = 5 + 1000;

ii arr[MAXN];
vector<int> od, ev;
int n,c[MAXN];

ll dist(ii p1, ii p2) {
  ll dx = p1.x - p2.x, dy = p1.y - p2.y;
  return dx * dx + dy * dy;
}

void dfs(int u) {
  ll mind = 1LL<<60;
  foi (v,0,n) {
    if (u == v) continue;
    mind = min(mind, dist(arr[u], arr[v]));
  }
  foi (v,0,n) {
    if (u == v) continue;
    if (dist(arr[u], arr[v]) == mind && c[v] == -1) {
      c[v] = 1 - c[u];
      dfs(v);
    }
  }
}

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  cin >> n;
  foi (i,0,n) {
    cin >> arr[i].x >> arr[i].y;
    if (((arr[i].x + arr[i].y) % 2) == 0) {
      ev.push_back(i);
    } else {
      od.push_back(i);
    }
  }
  if (n == 2) {
    cout << 1 << '\n';
    cout << 1 << '\n';
    return 0;
  }
  if (!ev.empty() && !od.empty()) {
    cout << ev.size() << '\n';
    for (int x : ev) {
      cout << 1 + x << ' ';
    }
    cout << '\n';
  } else {
    memset(c, -1, sizeof c);
    foi (i,0,n) {
      if (c[i] == -1) {
        c[i] = 0;
        dfs(i);
      }
    }
    vector<int> ans;
    foi (i,0,n) {
      if (c[i] == 0) {
        ans.push_back(i);
      }
    }
    assert(ans.size() > 0 && (int) ans.size() < n);
    cout << ans.size() << '\n';
    for (int x : ans) {
      cout << 1 + x << ' ';
    }
    cout << '\n';
  }
  return 0;
}


#include <bits/stdc++.h>
#define foi(i,k,n) for(int i = (int)k; i < (int)n; ++i)
#define x first
#define y second
using namespace std;
using ll = long long;
using ii = pair<int,int>;
constexpr int MAXN = 5 + 1000;

ii arr[MAXN];
vector<int> od, ev;
int n,c[MAXN];
vector<pair<ll,ii>> all;

ll dist(ii p1, ii p2) {
  ll dx = p1.x - p2.x, dy = p1.y - p2.y;
  return dx * dx + dy * dy;
}

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  cin >> n;
  foi (i,0,n) {
    cin >> arr[i].x >> arr[i].y;
    if (((arr[i].x + arr[i].y) % 2) == 0) {
      ev.push_back(i);
    } else {
      od.push_back(i);
    }
  }
  if (n == 2) {
    cout << 1 << '\n';
    cout << 1 << '\n';
    return 0;
  }
  if (!ev.empty() && !od.empty()) {
    cout << ev.size() << '\n';
    for (int x : ev) {
      cout << 1 + x << ' ';
    }
    cout << '\n';
  } else {
    all.reserve(n*n);
    foi (i,0,n) {
      foi (j,1+i,n) {
        all.push_back(pair<ll,ii>(dist(arr[i], arr[j]), {i, j}));
      }
    }

    memset(c, -1, sizeof c);
    sort(all.begin(), all.end());
    for (auto p : all) {
      if (p.first != all.front().first) break;
      int i,j; tie(i,j) = p.second;
      if (c[i] != -1 && c[j] != -1) continue;
      if (c[i] == -1 && c[j] == -1) {
        c[i] = 0;
        c[j] = 1;
      } else {
        if (c[i] != -1) {
          c[j] = 1 - c[i];
        } else {
          c[i] = 1 - c[j];
        }
      }
    }

    vector<int> ans;
    foi (i,0,n) {
      if (c[i] == 0) {
        ans.push_back(i);
      }
    }
    assert(ans.size() > 0 && (int) ans.size() < n);
    cout << ans.size() << '\n';
    for (int x : ans) {
      cout << 1 + x << ' ';
    }
    cout << '\n';
  }
  return 0;
}


#include <bits/stdc++.h>
#define foi(i,k,n) for(int i = (int)k; i < (int)n; ++i)
#define x first
#define y second
using namespace std;
using ll = long long;
using ii = pair<int,int>;
constexpr int MAXN = 5 + 1000;

int n;
ii arr[MAXN];

ll dist(ii p1, ii p2) {
  ll dx = p1.x - p2.x, dy = p1.y - p2.y;
  return dx * dx + dy * dy;
}

bool ok(const vector<int>& v) {
  vector<bool> l(n, false);
  for (int x : v) l[x] = true;
  set<ll> same, dif;
  foi (i,0,n) {
    foi (j,1+i,n) {
      if (l[i] == l[j]) {
        same.insert(dist(arr[i], arr[j]));
      } else {
        dif.insert(dist(arr[i], arr[j]));
      }
    }
  }
  for (auto p : same) {
    if (dif.find(p) != dif.end()) return false;
  }
  return true;
}

vector<int> solve();
vector<int> solve2();

vector<int> solve() {
  vector<int> v1, v2;
  foi (i,0,n) {
    if ((arr[i].x % 2) == 0 && (arr[i].y % 2) == 0) {
      v1.push_back(i);
    } else {
      v2.push_back(i);
    }
  }
  if (v1.size() > 0 && v2.size() > 0) { // hay {par, par} e {impar, impar}.
    return v1;
  } else if (v1.size() > 0) { // solo {par, par}.
    foi (i,0,n) arr[i].x /= 2, arr[i].y /= 2;
    return solve2();
  } else { // solo {impar, impar}.
    foi (i,0,n) arr[i].x++, arr[i].y++;
    return solve2();
  }
}

vector<int> solve2() {
  vector<int> ev,od;
  foi (i,0,n) {
    if (((arr[i].x + arr[i].y) % 2) == 0) ev.push_back(i);
    else od.push_back(i);
  }

  if (ev.size() > 0 && (int) ev.size() < n) { // hay pares e impares.
    return ev;
  } else if (ev.size() > 0) { // solo pares.
    return solve();
  } else { // solo impares.
    foi (i,0,n) arr[i].y++;
    return solve();
  }
}

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  cin >> n;
  foi (i,0,n) cin >> arr[i].x >> arr[i].y;

  vector<int> ans = solve2();
  cout << ans.size() << '\n';
  for (int x : ans) cout << 1 + x << ' ';
  cout << '\n';

  assert(ok(ans));
  assert(ans.size() > 0 && (int) ans.size() < n);
  return 0;
}


#include <bits/stdc++.h>
#define foi(i,k,n) for(int i = (int)k; i < (int)n; ++i)
#define x first
#define y second
using namespace std;
using ll = long long;
using ii = pair<int,int>;
constexpr int MAXN = 5 + 1000;

int n;
ii arr[MAXN];
vector<int> od, ev;

ll dist(ii p1, ii p2) {
  ll dx = p1.x - p2.x, dy = p1.y - p2.y;
  return dx * dx + dy * dy;
}

bool ok(const vector<int>& v) {
  vector<bool> l(n, false);
  for (int x : v) l[x] = true;
  set<ll> same, dif;
  foi (i,0,n) {
    foi (j,1+i,n) {
      if (l[i] == l[j]) {
        same.insert(dist(arr[i], arr[j]));
      } else {
        dif.insert(dist(arr[i], arr[j]));
      }
    }
  }
  for (auto p : same) {
    if (dif.find(p) != dif.end()) return false;
  }
  return true;
}

vector<int> solve(const vector<int>& v) {
  vector<int> v1, v2, ans;
  for (int p : v) {
    if ((arr[p].x % 2) == 0 && (arr[p].y % 2) == 0) {
      v1.push_back(p);
    } else {
      v2.push_back(p);
    }
  }
  if (v1.size() > 0 && v2.size() > 0) { // hay {par, par} e {impar, impar}.
    ans = v1;
  } else if (v1.size() > 0) { // solo {par, par}.
    for (int p : v1) {
      arr[p].x += 1000000;
      arr[p].y += 1000000;
    }
    sort(v1.begin(), v1.end(), [](const int& a, const int& b)->bool{
      return arr[a].x + arr[a].y < arr[b].x + arr[b].y;
    });
    vector<int> res;
    for (int dif = 1;; dif <<= 1) {
      res.clear();
      for (int p : v1) {
        assert(((arr[p].x + arr[p].y) % dif) == 0);
        int mul = (arr[p].x + arr[p].y) / dif;
        if (mul & 1) res.push_back(p);
      }
      if (res.size() > 0 && res.size() != v1.size()) return res;
    }
  } else { // solo {impar, impar}.
    foi (i,0,n) arr[i].x++, arr[i].y++;
    return solve(v);
  }
  return ans;
}

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  cin >> n;
  foi (i,0,n) {
    cin >> arr[i].x >> arr[i].y;
    if (((arr[i].x + arr[i].y) % 2) == 0) ev.push_back(i);
    else od.push_back(i);
  }

  vector<int> ans;
  if (ev.size() > 0 && (int) ev.size() < n) { // hay pares e impares.
    ans = ev;
  } else if (ev.size() > 0) { // solo pares.
    ans = solve(ev);
  } else { // solo impares.
    foi (i,0,n) arr[i].y++;
    ans = solve(od);
  }

  cout << ans.size() << '\n';
  for (int x : ans) cout << 1 + x << ' ';
  cout << '\n';

  assert(ok(ans));
  assert(ans.size() > 0 && (int) ans.size() < n);
  return 0;
}


#include <bits/stdc++.h>
#define foi(i,k,n) for(int i = (int)k; i < (int)n; ++i)
using namespace std;
using ll = long long;
using ii = pair<int,int>;
using llii = pair<ll,ii>;
constexpr int MAXN = 5 + 1000;
ii arr[MAXN];
ll f[MAXN][MAXN];

ll dist(int i, int j) {
  ll dx = arr[i].first - arr[j].first, dy = arr[i].second - arr[j].second;
  return dx*dx+dy*dy;
}

//  Split points in three sets of distances
// A = Distances of points on the left side
// C = Distances of points on the right side
queue<ii> q;
multiset<ll> A,C;
bool l[MAXN];

bool be(const multiset<ll>& t, ll d) {
  return t.find(d) != t.end();
}

void addB(int i, int j) {
  ll d = f[i][j];

  if (be(A, d) || be(C, d)) {
    q.push({i,j});
  }
}

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  int n; cin >> n;
  foi (i,0,n) {
    cin >> arr[i].first >> arr[i].second;
    l[i] = (i == 0);
  }

  foi (i,0,n) {
    foi (j,0,n) {
      f[i][j] = dist(i,j);
    }
  }

  foi (i,1,n) {
    foi (j,1+i,n) {
      C.insert(f[i][j]);
    }
  }

  foi (i,1,n) {
    addB(0,i);
  }

  while (!q.empty()) {
    auto pd = q.front(); q.pop();
    int a, b; tie(a,b) = pd;
    if (l[a] && l[b]) continue;

    if (!l[a]) swap(a,b);
    // assert(l[a] && !l[b]);
    if (A.find(f[a][b]) == A.end() && C.find(f[a][b]) == C.end()) continue;
    l[b] = true;

    foi (i,0,n) { // Update both sides
      if (i == b) continue;
      if (l[i]) {
        A.insert(f[i][b]);
      } else {
        C.erase(C.find(f[i][b]));
      }
    }

    foi (i,0,n) {
      if (i == b) continue;
      if (!l[i]) {
        addB(i,b);
      }
    }

  }

  int tot = 0;
  foi (i,0,n) tot += l[i];
  cout << tot << '\n';
  assert(tot > 0 && tot < n);
  foi (i,0,n) {
    if (!l[i]) continue;
    cout << 1 + i << ' ';
  }
  cout << '\n';
  return 0;
}


#include <bits/stdc++.h>
#define foi(i,k,n) for(int i = (int)k; i < (int)n; ++i)
using namespace std;
using ll = long long;
using ii = pair<int,int>;
using llii = pair<ll,ii>;
constexpr int MAXN = 5 + 1000;
ii arr[MAXN];
ll f[MAXN][MAXN];

ll dist(int i, int j) {
  ll dx = arr[i].first - arr[j].first, dy = arr[i].second - arr[j].second;
  return dx*dx+dy*dy;
}

//  Split points in three sets of distances
// A = Distances of points on the left side
// C = Distances of points on the right side
queue<ii> q;
multiset<ll> A,C;
bool l[MAXN];

bool be(const multiset<ll>& t, ll d) {
  return t.find(d) != t.end();
}

void addB(int i, int j) {
  ll d = f[i][j];

  if (be(A, d) || be(C, d)) {
    q.push({i,j});
  }
}

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  int n; cin >> n;
  foi (i,0,n) {
    cin >> arr[i].first >> arr[i].second;
    l[i] = (i == 0);
  }

  foi (i,0,n) {
    foi (j,0,n) {
      f[i][j] = dist(i,j);
    }
  }

  foi (i,1,n) {
    foi (j,1+i,n) {
      C.insert(f[i][j]);
    }
  }

  foi (i,1,n) {
    addB(0,i);
  }

  while (!q.empty()) {
    auto pd = q.front(); q.pop();
    int a, b; tie(a,b) = pd;
    if (l[a] && l[b]) continue;

    if (!l[a]) swap(a,b);
    // assert(l[a] && !l[b]);
    if (A.find(f[a][b]) == A.end() && C.find(f[a][b]) == C.end()) continue;
    l[b] = true;

    foi (i,0,n) { // Update both sides
      if (i == b) continue;
      if (l[i]) {
        A.insert(f[i][b]);
      } else {
        C.erase(C.find(f[i][b]));
        addB(i,b);
      }
    }

  }

  int tot = 0;
  foi (i,0,n) tot += l[i];
  cout << tot << '\n';
  // assert(tot > 0 && tot < n);
  foi (i,0,n) {
    if (!l[i]) continue;
    cout << 1 + i << ' ';
  }
  cout << '\n';
  return 0;
}


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

#define pb push_back
#define mk make_pair
#define lob lower_bound
#define upb upper_bound
#define fst first
#define scd second

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

namespace Fread{
	const int MAXN=1<<20;
	char buffer[MAXN],*S,*T;
	inline char getchar(){
		if(S==T){
			T=(S=buffer)+fread(buffer,1,MAXN,stdin);
			if(S==T) return EOF;
		}
		return *S++;
	}
}
#ifdef ONLINE_JUDGE
	#define getchar Fread::getchar
#endif
inline int read(){
	int f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
inline ll readll(){
	ll f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int MAXN=1005;
int n,cnt[2][2];
pii p[MAXN];
int main() {
	n=read();
	for(int i=1;i<=n;++i)p[i].fst=read()+1e6,p[i].scd=read()+1e6;
	while(1){
		memset(cnt,0,sizeof(cnt));
		for(int i=1;i<=n;++i)cnt[p[i].fst&1][p[i].scd&1]++;
		if(cnt[0][0]+cnt[1][1]>0&&cnt[0][1]+cnt[1][0]>0){
			printf("%d\n",cnt[0][0]+cnt[1][1]);
			for(int i=1;i<=n;++i){
				if(((p[i].fst&1)&&(p[i].scd&1))||(!(p[i].fst&1)&&!(p[i].scd&1)))printf("%d ",i);
			}
			puts("");return 0;
		}
//		if(cnt[0][0]>0&&cnt[1][1]>0){
//			printf("%d\n",cnt[1][1]);
//			for(int i=1;i<=n;++i){
//				if((p[i].fst&1)&&(p[i].scd&1))printf("%d ",i);
//			}
//			puts("");return 0;
//		}
//		if(cnt[0][1]>0&&cnt[1][0]>0){
//			printf("%d\n",cnt[0][1]);
//			for(int i=1;i<=n;++i){
//				if(!(p[i].fst&1)&&(p[i].scd&1))printf("%d ",i);
//			}
//			puts("");return 0;
//		}
//		for(int i=1;i<=n;++i)p[i].fst>>=1,p[i].scd>>=1;
		for(int i=1;i<=n;++i){
			int x=p[i].fst,y=p[i].scd;
			p[i].fst=(x+y)/2,p[i].scd=(x-y)/2;
		}
	}
	return 0;
}


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

#define pb push_back
#define mk make_pair
#define lob lower_bound
#define upb upper_bound
#define fst first
#define scd second

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

namespace Fread{
	const int MAXN=1<<20;
	char buffer[MAXN],*S,*T;
	inline char getchar(){
		if(S==T){
			T=(S=buffer)+fread(buffer,1,MAXN,stdin);
			if(S==T) return EOF;
		}
		return *S++;
	}
}
#ifdef ONLINE_JUDGE
	#define getchar Fread::getchar
#endif
inline int read(){
	int f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
inline ll readll(){
	ll f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int MAXN=1005;
int n,cnt[2][2];
pii p[MAXN];
int main() {
	n=read();
	for(int i=1;i<=n;++i)p[i].fst=read()+1e6,p[i].scd=read()+1e6;
	while(1){
		memset(cnt,0,sizeof(cnt));
		for(int i=1;i<=n;++i)cnt[p[i].fst&1][p[i].scd&1]++;
		if(cnt[0][0]+cnt[1][1]>0&&cnt[0][1]+cnt[1][0]>0){
			printf("%d\n",cnt[0][0]+cnt[1][1]);
			for(int i=1;i<=n;++i){
				if(((p[i].fst&1)&&(p[i].scd&1))||(!(p[i].fst&1)&&!(p[i].scd&1)))printf("%d ",i);
			}
			puts("");return 0;
		}
		if(cnt[0][0]>0&&cnt[1][1]>0){
			printf("%d\n",cnt[1][1]);
			for(int i=1;i<=n;++i){
				if((p[i].fst&1)&&(p[i].scd&1))printf("%d ",i);
			}
			puts("");return 0;
		}
		if(cnt[0][1]>0&&cnt[1][0]>0){
			printf("%d\n",cnt[0][1]);
			for(int i=1;i<=n;++i){
				if(!(p[i].fst&1)&&(p[i].scd&1))printf("%d ",i);
			}
			puts("");return 0;
		}
		int x=-1,y=-1;
		for(int i=0;i<=1;++i)for(int j=0;j<=1;++j)if(cnt[i][j])x=i,y=j;
		for(int i=1;i<=n;++i)p[i].fst=(p[i].fst-x)/2,p[i].scd=(p[i].scd-y)/2;
	}
	return 0;
}


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

#define pb push_back
#define mk make_pair
#define lob lower_bound
#define upb upper_bound
#define fst first
#define scd second

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

namespace Fread{
	const int MAXN=1<<20;
	char buffer[MAXN],*S,*T;
	inline char getchar(){
		if(S==T){
			T=(S=buffer)+fread(buffer,1,MAXN,stdin);
			if(S==T) return EOF;
		}
		return *S++;
	}
}
#ifdef ONLINE_JUDGE
	#define getchar Fread::getchar
#endif
inline int read(){
	int f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
inline ll readll(){
	ll f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int MAXN=1005;
int n,cnt[2][2];
pii p[MAXN];
int main() {
	n=read();
	for(int i=1;i<=n;++i)p[i].fst=read()+1e6,p[i].scd=read()+1e6;
	while(1){
		memset(cnt,0,sizeof(cnt));
		for(int i=1;i<=n;++i)cnt[p[i].fst&1][p[i].scd&1]++;
		if(cnt[0][0]+cnt[1][1]>0&&cnt[0][1]+cnt[1][0]>0){
			printf("%d\n",cnt[0][0]+cnt[1][1]);
			for(int i=1;i<=n;++i){
				if(((p[i].fst&1)&&(p[i].scd&1))||(!(p[i].fst&1)&&!(p[i].scd&1)))printf("%d ",i);
			}
			puts("");return 0;
		}
		if(cnt[0][0]>0&&cnt[1][1]>0){
			printf("%d\n",cnt[1][1]);
			for(int i=1;i<=n;++i){
				if((p[i].fst&1)&&(p[i].scd&1))printf("%d ",i);
			}
			puts("");return 0;
		}
		if(cnt[0][1]>0&&cnt[1][0]>0){
			printf("%d\n",cnt[0][1]);
			for(int i=1;i<=n;++i){
				if(!(p[i].fst&1)&&(p[i].scd&1))printf("%d ",i);
			}
			puts("");return 0;
		}
		for(int i=1;i<=n;++i)p[i].fst>>=1,p[i].scd>>=1;
	}
	return 0;
}


#include<cstdio>
#include<vector>
#include<cstring>
using namespace std;
int x[100100],y[100100],n,cnt[2][2];
vector<int>ans;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d%d",&x[i],&y[i]);
	while(1){
		memset(cnt,0,sizeof(cnt));
		for(int i=1;i<=n;i++)cnt[x[i]&1][y[i]&1]++;
		if(cnt[0][1]+cnt[1][0]&&cnt[0][0]+cnt[1][1]){
			for(int i=1;i<=n;i++)
				if((x[i]&1)^(y[i]&1))ans.push_back(i);
			printf("%d\n",ans.size());
			for(int i=0;i<ans.size();i++)
				printf("%d ",ans[i]);
			return 0;
		}
		if(cnt[0][1]+cnt[0][0]&&cnt[1][0]+cnt[1][1]){
			for(int i=1;i<=n;i++)
				if(x[i]&1)ans.push_back(i);
			printf("%d\n",ans.size());
			for(int i=0;i<ans.size();i++)
				printf("%d ",ans[i]);
			return 0;
		}
		for(int i=1;i<=n;i++)
			x[i]/=2,y[i]/=2;
	}
}


#include<cstdio>
#include<vector>
#include<cstring>
using namespace std;
int x[1010],y[1010],n,cnt[2][2];
vector<int>ans;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d%d",&x[i],&y[i]);
	while(1){
		memset(cnt,0,sizeof(cnt));
		for(int i=1;i<=n;i++)cnt[x[i]&1][y[i]&1]++;
		if(cnt[0][1]+cnt[1][0]&&cnt[0][0]+cnt[1][1]){
			for(int i=1;i<=n;i++)
				if((x[i]&1)^(y[i]&1))ans.push_back(i);
			printf("%d\n",ans.size());
			for(int i=0;i<ans.size();i++)
				printf("%d ",ans[i]);
			return 0;
		}
		if(cnt[0][1]+cnt[0][0]&&cnt[1][0]+cnt[1][1]){
			for(int i=1;i<=n;i++)
				if(x[i]&1)ans.push_back(i);
			printf("%d\n",ans.size());
			for(int i=0;i<ans.size();i++)
				printf("%d ",ans[i]);
			return 0;
		}
		for(int i=1;i<=n;i++)
			x[i]>>=1,y[i]>>=1;
	}
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
#define ll long long
struct point{
	int x,y;
}save[1010];
int n;

int main()
{
	scanf("%d",&n);
	for(int i = 1;i<=n;i++){
		scanf("%d%d",&save[i].x,&save[i].y);
	}
	for(int i =2;i<=n;i++){
		save[i].x-=save[1].x;
		save[i].y-=save[1].y;
	}
	save[1].x = save[1].y = 0;
	int ok = 0,num = 0;
	int xx = 1;
	while(xx){
		for(int i = 1;i<=n;i++){
			if(abs(save[i].x)%2==1||abs(save[i].y)%2==1)
				xx = 0;
		}
		if(xx){
			for(int i = 1;i<=n;i++){
				save[i].x/=2;
				save[i].y/=2;
			}
		}
//		printf("%d %d\n",save[2].x,save[2].y);
	}

	for(int i =1;i<=n;i++){
		num+=(abs(save[i].x+save[i].y)%2==1);
	}
	if(num){
		printf("%d\n",num);
		for(int i = 1;i<=n;i++){
			if(abs(save[i].x+save[i].y)%2==1) printf("%d ",i);
		}
	}
	else{
		int res = 0;
		for(int i =1;i<=n;i++){
			if(save[i].x&1) res++;

		}
		printf("%d\n",res);
		for(int i = 1;i<=n;i++){
			if(save[i].x&1) printf("%d ",i);
		}
	}

	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
#define ll long long
struct point{
	int x,y;
}save[1010];
int n;

int main()
{
	scanf("%d",&n);
	for(int i = 1;i<=n;i++){
		scanf("%d%d",&save[i].x,&save[i].y);
	}
	for(int i =2;i<=n;i++){
		save[i].x-=save[1].x;
		save[i].y-=save[1].y;
	}
	save[1].x = save[1].y = 0;
	int ok = 0,num = 0;
	int xx = 1;
	while(xx){
		for(int i = 1;i<=n;i++){
			if(abs(save[i].x)%2||abs(save[i].y)%2)
				xx = 0;
		}
		if(xx){
			for(int i = 1;i<=n;i++){
				save[i].x/=2;
				save[i].y/=2;
			}
		}
//		printf("%d %d\n",save[2].x,save[2].y);
	}

	for(int i =1;i<=n;i++){
		num+=((save[i].x+save[i].y)%2);
	}
	if(num){
		printf("%d\n",num);
		for(int i = 1;i<=n;i++){
			if((save[i].x+save[i].y)%2) printf("%d ",i);
		}
	}
	else{
		int res = 0;
		for(int i =1;i<=n;i++){
			if(save[i].x&1) res++;

		}
		printf("%d\n",res);
		for(int i = 1;i<=n;i++){
			if(save[i].x&1) printf("%d ",i);
		}
	}

	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
#define ll long long
struct point{
	int x,y;
}save[1010];
int n;

int main()
{
	scanf("%d",&n);
	for(int i = 1;i<=n;i++){
		scanf("%d%d",&save[i].x,&save[i].y);
	}
	for(int i =2;i<=n;i++){
		save[i].x-=save[1].x;
		save[i].y-=save[1].y;
	}
	save[1].x = save[1].y = 0;
	int ok = 0,num = 0;
	int xx = 1;
	while(xx){
		for(int i = 1;i<=n;i++){
			if(save[i].x%2==1||save[i].y%2==1)
				xx = 0;
		}
		if(xx){
			for(int i = 1;i<=n;i++){
				save[i].x/=2;
				save[i].y/=2;
			}
		}
	}

	for(int i =1;i<=n;i++){
		num+=((save[i].x+save[i].y)%2==1);
	}
	if(num){
		printf("%d\n",num);
		for(int i = 1;i<=n;i++){
			if((save[i].x+save[i].y)%2==1) printf("%d ",i);
		}
	}
	else{
		int res = 0;
		for(int i =1;i<=n;i++){
			if(save[i].x&1) res++;

		}
		printf("%d\n",res);
		for(int i = 1;i<=n;i++){
			if(save[i].x&1) printf("%d ",i);
		}
	}

	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
#define ll long long
struct point{
	int x,y;
}save[1010];
int n;

int main()
{
	scanf("%d",&n);
	for(int i = 1;i<=n;i++){
		scanf("%d%d",&save[i].x,&save[i].y);
	}
	for(int i =2;i<=n;i++){
		save[i].x-=save[1].x;
		save[i].y-=save[1].y;
	}
	save[1].x = save[1].y = 0;
	int ok = 0,num = 0;
	int xx = 1;
	while(xx){
		for(int i = 1;i<=n;i++){
			if(abs(save[i].x)%2==1||abs(save[i].y)%2==1)
				xx = 0;
		}
		if(xx){
			for(int i = 1;i<=n;i++){
				save[i].x/=2;
				save[i].y/=2;
			}
		}
//		printf("%d %d\n",save[2].x,save[2].y);
	}

	for(int i =1;i<=n;i++){
		num+=((save[i].x+save[i].y)%2==1);
	}
	if(num){
		printf("%d\n",num);
		for(int i = 1;i<=n;i++){
			if((save[i].x+save[i].y)%2==1) printf("%d ",i);
		}
	}
	else{
		int res = 0;
		for(int i =1;i<=n;i++){
			if(save[i].x&1) res++;

		}
		printf("%d\n",res);
		for(int i = 1;i<=n;i++){
			if(save[i].x&1) printf("%d ",i);
		}
	}

	return 0;
}


/*
d = (xa-xb)^2+(ya-yb)^2
01010101
10101010
01010101
10101010
按棋盘分组，0为白格，1为黑格
	同组的情况：(xa-xb)奇数,那么(ya-yb)必为奇数
			 	(xa-xb)偶数,那么(ya-yb)必为偶数
			 	所以 d 最后必定是偶数
	异组的情况：(xa-xb)奇数,那么(ya-yb)必为偶数
			 	(xa-xb)偶数,那么(ya-yb)必为奇数
				所以 d 最后必定是奇数
如果一次不够,分出来的点都在同一组，就分情况坐标系旋转45度，再重复上述过程
*/

#include<bits/stdc++.h>
using namespace std;
#define N 2005
#define ll long long

pair<ll,ll>p[N];
set<ll> s[2],t[2];

int main(){
	int n;cin>>n;
	for(int i=1;i<=n;i++){
		cin>>p[i].first>>p[i].second;
	}
	if(n==2){
		puts("1");
		puts("1");
		return 0;
	}

	while(1){
		for(int i=1;i<=n;i++)
			s[((p[i].first+p[i].second)%2+2)%2].insert(i);

		if(s[0].size() && s[1].size())break;
		else {
			if(((p[1].first+p[1].second)%2+2)%2==1){//以(0,-1)为中心旋转
				for(int i=1;i<=n;i++){
					int a = p[i].first - (p[i].second+1);
					int b = p[i].first + (p[i].second+1);
					p[i].first = a / 2;
					p[i].second = b / 2;
				}
			}
			else{//以(0,0)为中心旋转
				for(int i=1;i<=n;i++){
					int a = p[i].first + p[i].second;
					int b = p[i].first - p[i].second;
					p[i].first = a / 2;
					p[i].second = b / 2;
				}
			}
		}
		s[0].clear();
		s[1].clear();
	}

	cout<<s[1].size();
	puts("");
	for(auto x:s[1])cout<<x<<" ";

}


/*
d = (xa-xb)^2+(ya-yb)^2
01010101
10101010
01010101
10101010
按棋盘分组，0为白格，1为黑格
	同组的情况：(xa-xb)奇数,那么(ya-yb)必为奇数
			 	(xa-xb)偶数,那么(ya-yb)必为偶数
			 	所以 d 最后必定是偶数
	异组的情况：(xa-xb)奇数,那么(ya-yb)必为偶数
			 	(xa-xb)偶数,那么(ya-yb)必为奇数
				所以 d 最后必定是奇数
如果一次不够,分出来的点都在同一组，就分情况坐标系旋转45度，再重复上述过程
*/

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

pair<int,int>p[N];
set<int> s[2],t[2];

int main(){
	int n;cin>>n;
	for(int i=1;i<=n;i++){
		cin>>p[i].first>>p[i].second;
	}
	if(n==2){
		puts("1");
		puts("1");
		return 0;
	}

	int base = 2;
	while(1){
		for(int i=1;i<=n;i++)
			s[(p[i].first+p[i].second+base)%base != 0].insert(i);

		if(s[0].size() && s[1].size())break;
		else {
			if((p[1].first+p[1].second)%2==1){//以(0,1)为中心旋转
				for(int i=1;i<=n;i++){
					int a = p[i].first - (p[i].second-1);
					int b = p[i].first + (p[i].second-1);
					p[i].first = a / 2;
					p[i].second = b / 2;
				}
			}
			else{//以(0,0)为中心旋转
				for(int i=1;i<=n;i++){
					int a = p[i].first + p[i].second;
					int b = p[i].first - p[i].second;
					p[i].first = a / 2;
					p[i].second = b / 2;
				}
			}
		}
		s[0].clear();
		s[1].clear();
	}

	cout<<s[1].size();
	puts("");
	for(auto x:s[1])cout<<x<<" ";

}


/*
d = (xa-xb)^2+(ya-yb)^2
01010101
10101010
01010101
10101010
按棋盘分组，0为白格，1为黑格
	同组的情况：(xa-xb)奇数,那么(ya-yb)必为奇数
			 	(xa-xb)偶数,那么(ya-yb)必为偶数
			 	所以 d 最后必定是偶数
	异组的情况：(xa-xb)奇数,那么(ya-yb)必为偶数
			 	(xa-xb)偶数,那么(ya-yb)必为奇数
				所以 d 最后必定是奇数
如果一次不够,分出来的点都在同一组，就坐标系旋转45度，再重复上述过程
*/

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

pair<int,int>p[N];
set<int> s[2],t[2];

int main(){
	int n;cin>>n;
	for(int i=1;i<=n;i++)
		cin>>p[i].first>>p[i].second;

	if(n==2){
		puts("1");
		puts("1");
	}

	int base = 2;
	while(1){
		for(int i=1;i<=n;i++)
			s[(p[i].first+p[i].second+base)%base != 0].insert(i);

		if(s[0].size() && s[1].size())break;
		else {
			for(int i=1;i<=n;i++){
				int a = p[i].first + p[i].second;
				int b = p[i].first - p[i].second;
				p[i].first = a;
				p[i].second = b;
			}
		}
		s[0].clear();
		s[1].clear();
		base <<= 1;
	}

	cout<<s[1].size();
	puts("");
	for(auto x:s[1])cout<<x<<" ";

}


/*
d = (xa-xb)^2+(ya-yb)^2
01010101
10101010
01010101
10101010
按棋盘分组，0为白格，1为黑格
	同组的情况：(xa-xb)奇数,那么(ya-yb)必为奇数
			 	(xa-xb)偶数,那么(ya-yb)必为偶数
			 	所以 d 最后必定是偶数
	异组的情况：(xa-xb)奇数,那么(ya-yb)必为偶数
			 	(xa-xb)偶数,那么(ya-yb)必为奇数
				所以 d 最后必定是奇数
如果一次不够,分出来的点都在同一组，就分情况坐标系旋转45度，再重复上述过程
*/

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

pair<ll,ll>p[N];
set<ll> s[2],t[2];

int main(){
	int n;cin>>n;
	for(int i=1;i<=n;i++){
		cin>>p[i].first>>p[i].second;
	}
	if(n==2){
		puts("1");
		puts("1");
		return 0;
	}

	while(1){
		for(int i=1;i<=n;i++)
			s[((p[i].first+p[i].second)%2+2)%2].insert(i);

		if(s[0].size() && s[1].size())break;
		else {
			if((p[1].first+p[1].second)%2==1){//以(0,1)为中心旋转
				for(int i=1;i<=n;i++){
					int a = p[i].first - (p[i].second-1);
					int b = p[i].first + (p[i].second-1);
					p[i].first = a / 2;
					p[i].second = b / 2;
				}
			}
			else{//以(0,0)为中心旋转
				for(int i=1;i<=n;i++){
					int a = p[i].first + p[i].second;
					int b = p[i].first - p[i].second;
					p[i].first = a / 2;
					p[i].second = b / 2;
				}
			}
		}
		s[0].clear();
		s[1].clear();
	}

	cout<<s[1].size();
	puts("");
	for(auto x:s[1])cout<<x<<" ";

}


/*
d = (xa-xb)^2+(ya-yb)^2
01010101
10101010
01010101
10101010
按棋盘分组，0为白格，1为黑格
	同组的情况：(xa-xb)奇数,那么(ya-yb)必为奇数
			 	(xa-xb)偶数,那么(ya-yb)必为偶数
			 	所以 d 最后必定是偶数
	异组的情况：(xa-xb)奇数,那么(ya-yb)必为偶数
			 	(xa-xb)偶数,那么(ya-yb)必为奇数
				所以 d 最后必定是奇数
如果一次不够,分出来的点都在同一组，就分情况坐标系旋转45度，再重复上述过程
*/

#include<bits/stdc++.h>
using namespace std;
#define N 2005
#define ll long long

pair<ll,ll>p[N];
set<ll> s[2],t[2];

int main(){
	int n;cin>>n;
	for(int i=1;i<=n;i++){
		cin>>p[i].first>>p[i].second;
	}
	if(n==2){
		puts("1");
		puts("1");
		return 0;
	}

	while(1){
		for(int i=1;i<=n;i++)
			s[((p[i].first+p[i].second)%2+2)%2].insert(i);

		if(s[0].size() && s[1].size())break;
		else {
			if((p[1].first+p[1].second)%2==1){//以(0,-1)为中心旋转
				for(int i=1;i<=n;i++){
					int a = p[i].first - (p[i].second+1);
					int b = p[i].first + (p[i].second+1);
					p[i].first = a / 2;
					p[i].second = b / 2;
				}
			}
			else{//以(0,0)为中心旋转
				for(int i=1;i<=n;i++){
					int a = p[i].first + p[i].second;
					int b = p[i].first - p[i].second;
					p[i].first = a / 2;
					p[i].second = b / 2;
				}
			}
		}
		s[0].clear();
		s[1].clear();
	}

	cout<<s[1].size();
	puts("");
	for(auto x:s[1])cout<<x<<" ";

}


/*
d = (xa-xb)^2+(ya-yb)^2
01010101
10101010
01010101
10101010
按棋盘分组，0为白格，1为黑格
	同组的情况：(xa-xb)奇数,那么(ya-yb)必为奇数
			 	(xa-xb)偶数,那么(ya-yb)必为偶数
			 	所以 d 最后必定是偶数
	异组的情况：(xa-xb)奇数,那么(ya-yb)必为偶数
			 	(xa-xb)偶数,那么(ya-yb)必为奇数
				所以 d 最后必定是奇数
如果一次不够,分出来的点都在同一组，就坐标系旋转45度，再重复上述过程
*/

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

pair<int,int>p[N];
set<int> s[2],t[2];

int main(){
	int n;cin>>n;
	for(int i=1;i<=n;i++)
		cin>>p[i].first>>p[i].second;

	if(n==2){
		puts("1");
		puts("1");
		return 0;
	}

	int base = 2;
	while(1){
		for(int i=1;i<=n;i++)
			s[(p[i].first+p[i].second+base)%base != 0].insert(i);

		if(s[0].size() && s[1].size())break;
		else {
			for(int i=1;i<=n;i++){
				int a = p[i].first + p[i].second;
				int b = p[i].first - p[i].second;
				p[i].first = a;
				p[i].second = b;
			}
		}
		s[0].clear();
		s[1].clear();
		base <<= 1;
	}

	cout<<s[1].size();
	puts("");
	for(auto x:s[1])cout<<x<<" ";

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1005;
int n,cnt,ans[N],a[N],b[N];
int main()
{
	scanf("%d",&n);
	for(int i=1,x,y;i<=n;i++)
	{
		scanf("%d%d",&x,&y); a[i] = x, b[i] = y;
		if((x+y)&1)ans[++cnt] = i;
	}
	if(cnt == 0 || cnt == n)
	{
		cnt = 0;
		for(int i=1;i<=n;i++) if(a[i]&1)ans[++cnt] = i;
	}
	printf("%d\n",cnt);
	for(int i=1;i<=cnt;i++)printf("%d ",ans[i]);puts("");
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1005;
int n,cnt,ans[N],a[N],b[N];
int main()
{
	scanf("%d",&n);
	for(int i=1,x,y;i<=n;i++)
	{
		scanf("%d%d",&x,&y); a[i] = (x+y)>>1, b[i] = (x-y)>>1;
	}
	int now = 1;
	while(!cnt || cnt == n)
	{
		cnt = 0;
		for(int i=1;i<=n;i++)
			if((a[i]+b[i])&now)ans[++cnt] = i;
		now <<= 1;
	}
	printf("%d\n",cnt);
	for(int i=1;i<=cnt;i++)printf("%d ",ans[i]);puts("");
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1005;
int n,cnt,ans[N],a[N],b[N];
int main()
{
	scanf("%d",&n);
	for(int i=1,x,y;i<=n;i++)
	{
		scanf("%d%d",&x,&y); a[i] = x, b[i] = y;
		// if((x+y)&1)ans[++cnt] = i;
	}
	while(cnt == 0 || cnt == n)
	{
		cnt = 0;
		for(int i=1,x,y;i<=n;i++)
		{
			x = a[i] , y = b[i];
			if((a[i]+b[i])&1)ans[++cnt] = i;
			a[i] = (x+y)>>1, b[i] = (x-y)>>1;
		}
	}
	printf("%d\n",cnt);
	for(int i=1;i<=cnt;i++)printf("%d ",ans[i]);puts("");
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1005;
int n,cnt,ans[N],a[N],b[N];
int main()
{
	scanf("%d",&n);
	for(int i=1,x,y;i<=n;i++)
	{
		scanf("%d%d",&x,&y); a[i] = x, b[i] = y;
		if((x+y)&1)ans[++cnt] = i;
	}
	int now = 1;
	while(!cnt || cnt == n)
	{
		cnt = 0; now <<= 1;
		for(int i=1;i<=n;i++)
			if((a[i]+b[i])&now)ans[++cnt] = i;
	}
	printf("%d\n",cnt);
	for(int i=1;i<=cnt;i++)printf("%d ",ans[i]);puts("");
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n;
int x[maxn], y[maxn];
int main() {
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i) {
		scanf("%d%d", &x[i], &y[i]);
	}
	while(1) {
		int s = 0;
		for(int i = 1; i <= n; ++i) {
			if(x[i] + y[i] & 1) {
				++s;
			}
		}
		if(s && s < n) {
			printf("%d\n", s);
			for(int i = 1; i <= n; ++i) {
				if(x[i] + y[i] & 1) {
					printf("%d ", i);
				}
			}
			return 0;
		}
		for(int i = 1; i <= n; ++i) {
			s = y[i];
			(y[i] += x[i]) >>= 1;
			(x[i] -= s) >>= 1;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n;
int x[maxn], y[maxn];
int main() {
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i) {
		scanf("%d%d", &x[i], &y[i]);
	}
	while(1) {
		int s = 0;
		memset(cnt, 0, sizeof(cnt));
		for(int i = 1; i <= n; ++i) {
			++cnt[x[i] & 1][y[i] & 1];
		}
		vector<int> ans;
		if(cnt[0][0] + cnt[1][1] > 0 && cnt[0][1] + cnt[1][0] > 0) {
			for(int i = 1; i <= n; ++i) {
				if(x[i] + y[i] & 1) {
					ans.push_back(i);
				}
			}
			printf("%d\n", ans.size());
			for(auto x : ans) {
				printf("%d ", x);
			}
			return 0;
		}
		if(cnt[0][0] + cnt[0][1] > 0 && cnt[1][0] + cnt[1][1] > 0) {
			for(int i = 1; i <= n; ++i) {
				if(x[i] & 1) {
					ans.push_back(i);
				}
			}
			printf("%d\n", ans.size());
			for(auto x : ans) {
				printf("%d ", x);
			}
			return 0;
		}
		for(int i = 1; i <= n; ++i) {
			x[i] /= 2;
			y[i] /= 2;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n;
int x[maxn], y[maxn], cnt[2][2];
int main() {
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i) {
		scanf("%d%d", &x[i], &y[i]);
	}
	while(1) {
		int s = 0;
		memset(cnt, 0, sizeof(cnt));
		for(int i = 1; i <= n; ++i) {
			++cnt[x[i] & 1][y[i] & 1];
		}
		vector<int> ans;
		if(cnt[0][0] + cnt[1][1] > 0 && cnt[0][1] + cnt[1][0] > 0) {
			for(int i = 1; i <= n; ++i) {
				if(x[i] + y[i] & 1) {
					ans.push_back(i);
				}
			}
			printf("%d\n", ans.size());
			for(auto x : ans) {
				printf("%d ", x);
			}
			return 0;
		}
		if(cnt[0][0] + cnt[0][1] > 0 && cnt[1][0] + cnt[1][1] > 0) {
			for(int i = 1; i <= n; ++i) {
				if(x[i] & 1) {
					ans.push_back(i);
				}
			}
			printf("%d\n", ans.size());
			for(auto x : ans) {
				printf("%d ", x);
			}
			return 0;
		}
		for(int i = 1; i <= n; ++i) {
			x[i] /= 2;
			y[i] /= 2;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n;
int x[maxn], y[maxn];
int main() {
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i) {
		scanf("%d%d", &x[i], &y[i]);
	}
	while(1) {
		int s = 0;
		for(int i = 1; i <= n; ++i) {
			if(x[i] + y[i] & 1) {
				++s;
			}
		}
		if(s && s < n) {
			printf("%d\n", s);
			for(int i = 1; i <= n; ++i) {
				if(x[i] + y[i] & 1) {
					printf("%d ", i);
				}
			}
			return 0;
		}
		for(int i = 1; i <= n; ++i) {
			s = y[i];
			y[i] = (y[i] + x[i]) >> 1;
			x[i] = (x[i] - s) >> 1;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n;
int x[maxn], y[maxn], cnt[2][2];
int main() {
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i) {
		scanf("%d%d", &x[i], &y[i]);
	}
	while(1) {
		int s = 0;
		memset(cnt, 0, sizeof(cnt));
		for(int i = 1; i <= n; ++i) {
			++cnt[x[i] & 1][y[i] & 1];
		}
		vector<int> ans;
		if(cnt[0][0] + cnt[1][1] > 0 && cnt[0][1] + cnt[1][0] > 0) {
			for(int i = 1; i <= n; ++i) {
				if(x[i] + y[i] & 1) {
					ans.push_back(i);
				}
			}
			printf("%d\n", ans.size());
			for(auto x : ans) {
				printf("%d ", x);
			}
			return 0;
		}
		if(cnt[0][0] + cnt[0][1] > 0 && cnt[1][0] + cnt[1][1] > 0) {
			for(int i = 1; i <= n; ++i) {
				if(x[i] & 1) {
					ans.push_back(i);
				}
			}
			printf("%d\n", ans.size());
			for(auto x : ans) {
				printf("%d ", x);
			}
			return 0;
		}
		for(int i = 1; i <= n; ++i) {
			x[i] >>= 1;
			y[i] >>= 1;
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

//typedef tuple <int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;
typedef vector<int> vi;
typedef vector<ll> vll;

#define siz(x) (int)(x).size()
#define Y second
#define X first
#define IN insert
#define PB push_back
#define P pop_back
#define PU push
#define PO pop
//#define F find
#define ED end()
#define MP( a, b) make_pair( a, b )

//#define MOD 1000000007ll
#define INF 1000000000
#define endl "\n"
#define rep(a,i,b) for (ll i = (a); i < (b); ++i)
#define reps(a,i,b) for (ll i = (a); i <= (b); ++i)
#define repd( num, i, ed ) for(ll (i)= (num)-1; (i) >= ed; --(i))
#define repkt( bg, i, num, kt ) for(ll (i)= (bg); (i) < (num) && (kt); ++(i))
#define repchar( i ) for(char (i)= 48; (i) <= 122; (i)++)
#define in(n) scanf("%lld", &n)
#define out(n) printf("%lld\n", n)
#define outS(s) printf("%s\n", s)
#define setA(a,n) for(ll i= 0, j= sizeof(a)/sizeof(a[0]); i < j; ++i) a[i]= n;
#define repe(num,i,ed) for(ll (i)= (num); (i) >= ed; --(i))
// const int INF=0x3f3f3f3f;
const db PI=acos(-1);
const ll mod=1e9+7;
const ll MOD=998244353;
const ll N=1e3+5,K=105;
const int si=(1<<20);
const ll M=2000+5;
const double INFdb=1e10;
const ll oo=1e18;

int n;
ll x[N],y[N];
map<ll,ll> id;
vll distt;

ll dist(int i,int j)
{
	ll xx=x[i]-x[j];
	ll yy=y[i]-y[j];
	return xx*xx+yy*yy;
}

map<ll,vector<pii> > maps;
vector<pii> vec[N];
ll len[N][N];
vi v[N];
bool used[N];
int cnt;

void dfs(int u)
{
	used[u]=1;
	++cnt;
	for(int x:v[u])
	{
		if(!used[x])
		{
			dfs(x);
		}
	}
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
    #ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    #endif
    cin>>n;
    ll g=0;
    ll num=0;
    for(int i=1;i<=n;++i) cin>>x[i]>>y[i];
    for(int i=1;i<=n;++i)
    {
    	for(int j=1;j<i;++j)
    	{
    		ll ddist=dist(i,j);
    		len[i][j]=len[j][i]=ddist;
    		g=__gcd(g,ddist);
    		if(!id[ddist])
    		{
    			id[ddist]=++num;
    			distt.PB(ddist);
    		}
    		vec[num-1].PB(mp(i,j));
    	}
    }
    // cout<<g<<endl;
    for(ll x:distt)
    {
    	int idd=id[x];
    	for(pii p:vec[idd-1])
    	{
    		int ff=p.X;
    		int ss=p.Y;
    		ll distance=len[ff][ss];
    		if((distance/g)%2==0)
    		{
    			// cout<<"hello"<<endl;
    			v[ff].PB(ss);
    			v[ss].PB(ff);
    		}
    	}
    }
    dfs(1);
    cout<<cnt<<endl;
    for(int i=1;i<=n;++i) if(used[i]) cout<<i<<" ";
    cerr<<"\nTime elapsed: "<<1000*clock()/CLOCKS_PER_SEC<<"ms\n";
    return 0;
}

//https://codeforces.com/contest/271/problem/D


#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

//typedef tuple <int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;
typedef vector<int> vi;
typedef vector<ll> vll;

#define siz(x) (int)(x).size()
#define Y second
#define X first
#define IN insert
#define PB push_back
#define P pop_back
#define PU push
#define PO pop
//#define F find
#define ED end()
#define MP( a, b) make_pair( a, b )

//#define MOD 1000000007ll
#define INF 1000000000
#define endl "\n"
#define rep(a,i,b) for (ll i = (a); i < (b); ++i)
#define reps(a,i,b) for (ll i = (a); i <= (b); ++i)
#define repd( num, i, ed ) for(ll (i)= (num)-1; (i) >= ed; --(i))
#define repkt( bg, i, num, kt ) for(ll (i)= (bg); (i) < (num) && (kt); ++(i))
#define repchar( i ) for(char (i)= 48; (i) <= 122; (i)++)
#define in(n) scanf("%lld", &n)
#define out(n) printf("%lld\n", n)
#define outS(s) printf("%s\n", s)
#define setA(a,n) for(ll i= 0, j= sizeof(a)/sizeof(a[0]); i < j; ++i) a[i]= n;
#define repe(num,i,ed) for(ll (i)= (num); (i) >= ed; --(i))
// const int INF=0x3f3f3f3f;
const db PI=acos(-1);
const ll mod=1e9+7;
const ll MOD=998244353;
const ll N=1e3+5,K=105;
const int si=(1<<20);
const ll M=2000+5;
const double INFdb=1e10;
const ll oo=1e18;

int n;
ll x[N],y[N];
map<ll,ll> id;
vll distt;

ll dist(int i,int j)
{
	ll xx=x[i]-x[j];
	ll yy=y[i]-y[j];
	return xx*xx+yy*yy;
}

map<ll,vector<pii> > maps;
vector<pii> vec[N];
ll len[N][N];
vi v[N];
bool used[N];
int cnt;

void dfs(int u)
{
	used[u]=1;
	++cnt;
	for(int x:v[u])
	{
		if(!used[x])
		{
			dfs(x);
		}
	}
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
    #ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    #endif
    cin>>n;
    ll g=0;
    ll num=0;
    for(int i=1;i<=n;++i) cin>>x[i]>>y[i];
    for(int i=1;i<=n;++i)
    {
    	for(int j=1;j<i;++j)
    	{
    		ll ddist=dist(i,j);
    		len[i][j]=len[j][i]=ddist;
    		g=__gcd(g,ddist);
    		if(!id[ddist])
    		{
    			id[ddist]=++num;
    			distt.PB(ddist);
    		}
    		vec[num-1].PB(mp(i,j));
    	}
    }
    // cout<<g<<endl;
    for(ll x:distt)
    {
    	ll idd=id[x];
    	for(pii p:vec[idd-1])
    	{
    		int ff=p.X;
    		int ss=p.Y;
    		ll distance=len[ff][ss];
    		if((distance/g)%2==0)
    		{
    			// cout<<"hello"<<endl;
    			v[ff].PB(ss);
    			v[ss].PB(ff);
    		}
    	}
    }
    dfs(1);
    cout<<cnt<<endl;
    for(int i=1;i<=n;++i) if(used[i]) cout<<i<<" ";
    cerr<<"\nTime elapsed: "<<1000*clock()/CLOCKS_PER_SEC<<"ms\n";
    return 0;
}

//https://codeforces.com/contest/271/problem/D


#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

//typedef tuple <int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;
typedef vector<int> vi;
typedef vector<ll> vll;

#define siz(x) (int)(x).size()
#define Y second
#define X first
#define IN insert
#define PB push_back
#define P pop_back
#define PU push
#define PO pop
//#define F find
#define ED end()
#define MP( a, b) make_pair( a, b )

//#define MOD 1000000007ll
#define INF 1000000000
#define endl "\n"
#define rep(a,i,b) for (ll i = (a); i < (b); ++i)
#define reps(a,i,b) for (ll i = (a); i <= (b); ++i)
#define repd( num, i, ed ) for(ll (i)= (num)-1; (i) >= ed; --(i))
#define repkt( bg, i, num, kt ) for(ll (i)= (bg); (i) < (num) && (kt); ++(i))
#define repchar( i ) for(char (i)= 48; (i) <= 122; (i)++)
#define in(n) scanf("%lld", &n)
#define out(n) printf("%lld\n", n)
#define outS(s) printf("%s\n", s)
#define setA(a,n) for(ll i= 0, j= sizeof(a)/sizeof(a[0]); i < j; ++i) a[i]= n;
#define repe(num,i,ed) for(ll (i)= (num); (i) >= ed; --(i))
// const int INF=0x3f3f3f3f;
const db PI=acos(-1);
const ll mod=1e9+7;
const ll MOD=998244353;
const ll N=1e6+5,K=105;
const int si=(1<<20);
const ll M=2000+5;
const double INFdb=1e10;
const ll oo=1e18;

int n;
ll x[N],y[N];
map<ll,ll> id;
vll distt;

ll dist(int i,int j)
{
	ll xx=x[i]-x[j];
	ll yy=y[i]-y[j];
	return xx*xx+yy*yy;
}

map<ll,vector<pii> > maps;
vector<pii> vec[N];
ll len[1005][1005];
vi v[N];
bool used[N];
int cnt;

void dfs(int u)
{
	used[u]=1;
	++cnt;
	for(int x:v[u])
	{
		if(!used[x])
		{
			dfs(x);
		}
	}
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
    #ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    #endif
    cin>>n;
    ll g=0;
    ll num=0;
    for(int i=1;i<=n;++i) cin>>x[i]>>y[i];
    for(int i=1;i<=n;++i)
    {
    	for(int j=1;j<i;++j)
    	{
    		ll ddist=dist(i,j);
    		len[i][j]=len[j][i]=ddist;
    		g=__gcd(g,ddist);
    		if(!id[ddist])
    		{
    			id[ddist]=++num;
    			distt.PB(ddist);
    		}
    		vec[num-1].PB(mp(i,j));
    	}
    }
    // cout<<g<<endl;
    for(ll x:distt)
    {
    	ll idd=id[x];
    	for(pii p:vec[idd-1])
    	{
    		int ff=p.X;
    		int ss=p.Y;
    		ll distance=len[ff][ss];
    		if((distance/g)%2==0)
    		{
    			// cout<<"hello"<<endl;
    			v[ff].PB(ss);
    			v[ss].PB(ff);
    		}
    	}
    }
    dfs(1);
    cout<<cnt<<endl;
    for(int i=1;i<=n;++i) if(used[i]) cout<<i<<" ";
    cerr<<"\nTime elapsed: "<<1000*clock()/CLOCKS_PER_SEC<<"ms\n";
    return 0;
}

//https://codeforces.com/contest/271/problem/D


#include <iostream>
#include <fstream>
#include <queue>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_map>
#include <type_traits>
#include <random>
#include <bitset>
#include <cstring>
#include <stack>
#include <stdlib.h>
#include <map>
#include <set>
using namespace std;
#define SERVER 1
const string nameFile="test";
ifstream in (nameFile+".in");
ofstream out(nameFile+".out");
typedef long long ll;
typedef pair <int, int> pii;
#if (SERVER)
    #define in cin
    #define out cout
#endif
const int nmax=1e3;
const int cc=1<<20;
int n, x, y;
vector <int> vec01, vec10, vec00, vec11;
pair <int, int> a[nmax+2];
int nrPrima;
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    in>>n;
    if(n==2){
        out<<"1\n1\n";
        return 0;
    }
    for(int i=1; i<=n; i++){
        in>>x>>y;
        a[i]={x+cc, y+cc};
    }
    bool ok=false;
    do{
        vec00.clear(); vec01.clear(); vec10.clear(); vec11.clear();
        for(int i=1; i<=n; i++){
            if(a[i].first%2==0){
                if(a[i].second%2==0)
                    vec00.push_back(i);
                else
                    vec01.push_back(i);
            }
            else{
                if(a[i].second%2==0)
                    vec10.push_back(i);
                else
                    vec11.push_back(i);
            }
            a[i].first/=2, a[i].second/=2;
        }
        if(vec00.size()+vec11.size()!=0&&vec01.size()+vec10.size()!=0){ ///daca ambele sunt diferite de 0
            out<<vec00.size()+vec11.size()<<"\n";
            for(auto & x:vec00)
                out<<x<<" ";
            for(auto & x:vec11)
                out<<x<<" ";
            return 0;
        }
        else if(vec00.size()+vec11.size()!=0){
            if(vec00.size()==0||vec11.size()==0)
                continue;
            out<<vec00.size()<<"\n";
            for(auto & x:vec00)
                out<<x<<" ";
            return 0;
        }
        else if(vec01.size()+vec10.size()!=0){
            if(vec01.size()==0||vec10.size()==0)
                continue;
            out<<vec01.size()<<"\n";
            for(auto & x:vec01)
                out<<x<<" ";
            return 0;
        }
    }
    while(!ok);
    return 0;
}


#include <iostream>
#include <fstream>
#include <queue>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_map>
#include <type_traits>
#include <random>
#include <bitset>
#include <cstring>
#include <stack>
#include <stdlib.h>
#include <map>
#include <set>
using namespace std;
#define SERVER 1
const string nameFile="test";
ifstream in (nameFile+".in");
ofstream out(nameFile+".out");
typedef long long ll;
typedef pair <int, int> pii;
#if (SERVER)
    #define in cin
    #define out cout
#endif
const int nmax=1e3;
const int cc=1<<20;
int n, x, y;
vector <int> vec1;
pair <int, int> a[nmax+2];
int nrPrima;
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    in>>n;
    if(n==2){
        out<<"1\n1\n";
        return 0;
    }
    for(int i=1; i<=n; i++){
        in>>x>>y;
        a[i]={x+cc, y+cc};
    }
    do{
        nrPrima=0;
        vec1.clear();
        for(int i=1; i<=n; i++){
            if((a[i].first+a[i].second)%2==0)
                nrPrima++, vec1.push_back(i);
            a[i].first/=2, a[i].second/=2;
        }
    }
    while(nrPrima==0||nrPrima==n);

    out<<vec1.size()<<"\n";
    for(auto &x:vec1)
        out<<x<<" ";

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1005;
int n,tt,x[N],y[N],vis[N],ps[N];
long long b[N][N];
vector<int>g[N];
pair<long long,int>a[N];
inline void dfs(int x)
{
	ps[++tt]=x;vis[x]=1;
	for(int i=0;i<g[x].size();i++)if(!vis[g[x][i]])dfs(g[x][i]);
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d",&x[i],&y[i]);
	for(int i=1;i<=n;i++)if((x[i]+y[i])%2)ps[++tt]=i;
	if(tt&&tt<n)
	{
		printf("%d\n",tt);
		for(int i=1;i<=tt;i++)printf("%d ",ps[i]);
		return 0;
	}
	for(int i=2;i<=n;i++)x[i]-=x[1],y[i]-=y[1];
	x[1]=y[1]=0;
	while(true)
	{
		int ff=0;
		for(int i=1;i<=n;i++)if(x[i]%2)ff=1;
		if(ff)break;
		for(int i=1;i<=n;i++)x[i]/=2,y[i]/=2;
	}
	tt=0;
	for(int i=1;i<=n;i++)if(x[i]%2)ps[++tt]=i;
	printf("%d\n",tt);
	for(int i=1;i<=tt;i++)printf("%d ",ps[i]);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1005;
int n,tt,x[N],y[N],vis[N],ps[N];
long long b[N][N];
pair<long long,int>a[N];
inline void dfs(int x)
{
	ps[++tt]=x;vis[x]=1;
	for(int i=0;i<g[x].size();i++)if(!vis[g[x][i]])dfs(g[x][i]);
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d",&x[i],&y[i]);
	for(int i=1;i<=n;i++)
	{
		int nn=0;
		for(int j=1;j<=n;j++)if(j!=i)b[i][j]=a[++nn]=make_pair(1ll*(x[i]-x[j])*(x[i]-x[j])+1ll*(y[i]-y[j])*(y[i]-y[j]),j);
		sort(a+1,a+nn+1);
		for(int j=1,k;j<=nn;j++)
		{
			for(k=j;k<nn&&a[k+1].first==a[j].first;k++);
			for(int t=j+1;t<=k;t++)
			{
				g[a[j].second].push_back(a[t].second);
				g[a[t].second].push_back(a[j].second);
			}
			j=k;
		}
	}
	for(int i=1;i<=n;i++)if(!vis[i])dfs(1);
	printf("%d\n",tt);
	for(int i=1;i<=tt;i++)printf("%d ",ps[i]);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1005;
int n,tt,x[N],y[N],vis[N],ps[N];
vector<int>g[N];
pair<long long,int>a[N];
inline void dfs(int x)
{
	ps[++tt]=x;vis[x]=1;
	for(int i=0;i<g[x].size();i++)if(!vis[g[x][i]])dfs(g[x][i]);
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d",&x[i],&y[i]);
	for(int i=1;i<=n;i++)
	{
		int nn=0;
		for(int j=1;j<=n;j++)if(j!=i)a[++nn]=make_pair(1ll*(x[i]-x[j])*(x[i]-x[j])+1ll*(y[i]-y[j])*(y[i]-y[j]),j);
		sort(a+1,a+nn+1);
		for(int j=1,k;j<=nn;j++)
		{
			for(k=j;k<nn&&a[k+1].first==a[j].first;k++);
			for(int t=j+1;t<=k;t++)
			{
				g[a[j].second].push_back(a[t].second);
				g[a[t].second].push_back(a[j].second);
			}
			j=k;
		}
	}
	dfs(1);printf("%d\n",tt);
	for(int i=1;i<=tt;i++)printf("%d ",ps[i]);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1005;
int n,tt,x[N],y[N],vis[N],ps[N];
vector<int>g[N];
long long b[N][N];
pair<long long,int>a[N];
inline void dfs(int x)
{
	ps[++tt]=x;vis[x]=1;
	for(int i=0;i<g[x].size();i++)if(!vis[g[x][i]])dfs(g[x][i]);
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d",&x[i],&y[i]);
	for(int i=1;i<=n;i++)
	{
		int nn=0;
		for(int j=1;j<=n;j++)if(j!=i)b[i][j]=1ll*(x[i]-x[j])*(x[i]-x[j])+1ll*(y[i]-y[j])*(y[i]-y[j]),a[++nn]=make_pair(b[i][j],j);
		sort(a+1,a+nn+1);
		for(int j=1,k;j<=nn;j++)
		{
			for(k=j;k<nn&&a[k+1].first==a[j].first;k++);
			for(int t=j+1;t<=k;t++)
			{
				g[a[j].second].push_back(a[t].second);
				g[a[t].second].push_back(a[j].second);
			}
			j=k;
		}
	}
	for(int i=1;i<=n;i++)if(!g[i].size())
	{
		printf("1\n%d\n",i);
		return 0;
	}
	for(int i=1;i<=n;i++)if(!vis[i])dfs(1);
	printf("%d\n",tt);
	for(int i=1;i<=tt;i++)printf("%d ",ps[i]);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1005;
int n,tt,x[N],y[N],vis[N],ps[N];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d",&x[i],&y[i]);
	for(int i=1;i<=n;i++)if((x[i]&1)==(y[i]&1))ps[++tt]=i;
	printf("%d\n",tt);
	for(int i=1;i<=tt;i++)printf("%d ",ps[i]);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1005;
int n,tt,x[N],y[N],vis[N],ps[N];
long long b[N][N];
pair<long long,int>a[N];
inline void dfs(int x)
{
	ps[++tt]=x;vis[x]=1;
	for(int i=0;i<g[x].size();i++)if(!vis[g[x][i]])dfs(g[x][i]);
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d",&x[i],&y[i]);
	for(int i=1;i<=n;i++)
	{
		int nn=0;
		for(int j=1;j<=n;j++)if(j!=i)b[i][j]=1ll*(x[i]-x[j])*(x[i]-x[j])+1ll*(y[i]-y[j])*(y[i]-y[j]),a[++nn]=make_pair(b[i][j],j);
		sort(a+1,a+nn+1);
		for(int j=1,k;j<=nn;j++)
		{
			for(k=j;k<nn&&a[k+1].first==a[j].first;k++);
			for(int t=j+1;t<=k;t++)
			{
				g[a[j].second].push_back(a[t].second);
				g[a[t].second].push_back(a[j].second);
			}
			j=k;
		}
	}
	for(int i=1;i<=n;i++)if(!vis[i])dfs(1);
	printf("%d\n",tt);
	for(int i=1;i<=tt;i++)printf("%d ",ps[i]);
	return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <climits>
#include <functional>
/* Data Structure */
#include <vector>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <stack>
#include <queue>

#define ll long long
#define ld long double

using namespace std;

int n;

int cnt[2][2];

int main()
{
	cin>>n;
	vector<pair<int,int>> points(n);
	for(int i=0;i<n;++i)
	{
		int a,b;

		cin>>a>>b;

		//cout << a << " " <<b<< endl;
		a+=100000;
		b+=100000;
		points[i] = make_pair(a,b);
		cnt[a%2][b%2]++;
	}

	// if there are odd sums and even sums :D
	vector<int> ans;
	bool flag = false;
	while(!flag)
	{
		memset(cnt,0,sizeof(cnt));
		for(int i=0;i<n;++i)
		{
			cnt[points[i].first%2][points[i].second%2]++;
		}
		if(cnt[0][0]+cnt[1][1]>0 && cnt[0][1]+cnt[1][0]>0)
		{
			for(int i=0;i<n;++i)
			{
				if((points[i].first+points[i].second)%2==0)
				{
					ans.emplace_back(i);
				}
			}
			cout << ans.size() << endl;
			for(int i=0;i<ans.size();++i)
			{
				cout << ans[i]+1 << " ";
			}
			cout << endl;
			return 0;
		}
		else if(cnt[0][0]>0 && cnt[1][1]>0)
		{
			for(int i=0;i<n;++i)
			{
				if(points[i].first%2==0 && points[i].second%2==0)
				{
					ans.emplace_back(i);
				}
			}
			cout << ans.size() << endl;
			for(int i=0;i<ans.size();++i)
			{
				cout << ans[i]+1 << " ";
			}
			cout << endl;
			return 0;
		}
		else if(cnt[0][1]>0 && cnt[1][0]>0)
		{
			//cout << cnt[0][1] << " " << cnt[1][0] << endl;
			for(int i=0;i<n;++i)
			{
				if(points[i].first%2==0 && points[i].second%2==1)
				{
					ans.emplace_back(i);
				}
			}
			cout << ans.size() << endl;
			for(int i=0;i<ans.size();++i)
			{
				cout << ans[i]+1 << " ";
			}
			cout << endl;
			return 0;
		}
		else
		{
			for(int i=0;i<points.size();++i)
			{
				points[i].first/=2;
				points[i].second/=2;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <climits>
#include <functional>
/* Data Structure */
#include <vector>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <stack>
#include <queue>

#define ll long long
#define ld long double

using namespace std;

int n;

int cnt[2][2];

int main()
{
	cin>>n;
	vector<pair<int,int>> points(n);
	for(int i=0;i<n;++i)
	{
		int a,b;

		cin>>a>>b;

		//cout << a << " " <<b<< endl;
		points[i] = make_pair(a+1000000,b+1000000);
		cnt[a%2][b%2]++;
	}

	// if there are odd sums and even sums :D
	vector<int> ans;
	bool flag = false;
	while(!flag)
	{
		memset(cnt,0,sizeof(cnt));
		for(int i=0;i<n;++i)
		{
			cnt[points[i].first%2][points[i].second%2]++;
		}
		if(cnt[0][0]+cnt[1][1]>0 && cnt[0][1]+cnt[1][0]>0)
		{
			for(int i=0;i<n;++i)
			{
				if((points[i].first+points[i].second)%2==0)
				{
					ans.emplace_back(i);
				}
			}
			cout << ans.size() << endl;
			for(int i=0;i<ans.size();++i)
			{
				cout << ans[i]+1 << " ";
			}
			cout << endl;
			return 0;
		}
		else if(cnt[0][0]>0 && cnt[1][1]>0)
		{
			for(int i=0;i<n;++i)
			{
				if(points[i].first%2==0 && points[i].second%2==0)
				{
					ans.emplace_back(i);
				}
			}
			cout << ans.size() << endl;
			for(int i=0;i<ans.size();++i)
			{
				cout << ans[i]+1 << " ";
			}
			cout << endl;
			return 0;
		}
		else if(cnt[0][1]>0 && cnt[1][0]>0)
		{
			//cout << cnt[0][1] << " " << cnt[1][0] << endl;
			for(int i=0;i<n;++i)
			{
				if(points[i].first%2==0 && points[i].second%2==1)
				{
					ans.emplace_back(i);
				}
			}
			cout << ans.size() << endl;
			for(int i=0;i<ans.size();++i)
			{
				cout << ans[i]+1 << " ";
			}
			cout << endl;
			return 0;
		}
		else
		{
			for(int i=0;i<points.size();++i)
			{
				points[i].first/=2;
				points[i].second/=2;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <climits>
#include <functional>
/* Data Structure */
#include <vector>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <stack>
#include <queue>

#define ll long long
#define ld long double

using namespace std;

int n;

int cnt[2][2];

int main()
{
	cin>>n;
	vector<pair<int,int>> points(n);
	for(int i=0;i<n;++i)
	{
		int a,b;

		cin>>a>>b;

		//cout << a << " " <<b<< endl;
		a+=1000000;
		b+=1000000;
		points[i] = make_pair(a,b);
		cnt[a%2][b%2]++;
	}

	// if there are odd sums and even sums :D
	vector<int> ans;
	bool flag = false;
	while(!flag)
	{
		memset(cnt,0,sizeof(cnt));
		for(int i=0;i<n;++i)
		{
			// cout << points[i].first << " " << points[i].second << endl;
			// cout << points[i].first %2 << " " << points[i].second %2 << endl;
			// cout << endl;
			cnt[points[i].first%2][points[i].second%2]++;
		}
		if(cnt[0][0]+cnt[1][1]>0 && cnt[0][1]+cnt[1][0]>0)
		{
			for(int i=0;i<n;++i)
			{
				if((points[i].first+points[i].second)%2==0)
				{
					ans.emplace_back(i);
				}
			}
			cout << ans.size() << endl;
			for(int i=0;i<ans.size();++i)
			{
				cout << ans[i]+1 << " ";
			}
			cout << endl;
			return 0;
		}
		else if(cnt[0][0]>0 && cnt[1][1]>0)
		{
			for(int i=0;i<n;++i)
			{
				if(points[i].first%2==0 && points[i].second%2==0)
				{
					ans.emplace_back(i);
				}
			}
			cout << ans.size() << endl;
			for(int i=0;i<ans.size();++i)
			{
				cout << ans[i]+1 << " ";
			}
			cout << endl;
			return 0;
		}
		else if(cnt[0][1]>0 && cnt[1][0]>0)
		{
			//cout << cnt[0][1] << " " << cnt[1][0] << endl;
			for(int i=0;i<n;++i)
			{
				if(points[i].first%2==0 && points[i].second%2==1)
				{
					ans.emplace_back(i);
				}
			}
			cout << ans.size() << endl;
			for(int i=0;i<ans.size();++i)
			{
				cout << ans[i]+1 << " ";
			}
			cout << endl;
			return 0;
		}
		else
		{
			for(int i=0;i<points.size();++i)
			{
				points[i].first/=2;
				points[i].second/=2;
			}
		}
	}
	return 0;
}


#include <bits/stdc++.h>

#define int long long
#define pb push_back
#define F first
#define S second

using namespace std;

const int MX=1e3+9;
int dis[MX][MX];

int fasl(int x1,int y1,int x2,int y2){
    return ((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

int32_t main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    vector <int> v;
    int x[n],y[n];
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
        if((x[i]+y[i])%2){
            v.pb(i+1);
        }
    }
    if(v.size()==0 || v.size()==n){
        v.clear();
        for(int i=0;i<n;i++){
            if(x[i]%2){
                v.pb(i+1);
            }
        }
    }
    if(v.size()==0 || v.size()==n){
        v.clear();
        for(int i=0;i<n;i++){
            if(y[i]%2){
                v.pb(i+1);
            }
        }
    }
    cout<<v.size()<<endl;
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>

#define int long long
#define pb push_back
#define F first
#define S second

using namespace std;

const int MX=1e3+9;
int dis[MX][MX];

int fasl(int x1,int y1,int x2,int y2){
    return ((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

int32_t main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    int x[n],y[n];
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
    }
    cout<<1<<endl<<1;
    return 0;
}


/*input
3
0 0
0 1
1 0

*/
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll n;
ll x[1010], y[1010];
ll t[1010];
vector<ll>p;
map<ll, bool>M;
ll d(ll i, ll j)
{
	i = p[i];
	j = p[j];
	ll a = x[i] - x[j];
	ll b = y[i] - y[j];
	return a * a + b * b;
}
void ieskok(ll i)
{
	if (i == n)
	{
		ll kiek = 0;
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				kiek++;
		}
		if (kiek == 0 || kiek == n)
			return;
		cout << kiek << "\n";
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				cout << i + 1 << " ";
		}
		cout << "\n";
		exit(0);
	}
	for (t[p[i]] = 0; t[p[i]] <= 1; t[p[i]]++)
	{
		bool ok = true;
		for (ll j = 0; j < i; j++)
		{
			bool x = t[p[i]] != t[p[j]];
			ll di = d(i, j);
			if (M.count(di))
			{
				if (M[di] != x)
				{
					ok = false;
					break;
				}
			}
		}
		if (ok)
		{
			vector<ll>at;
			for (ll j = 0; j < i; j++)
			{
				bool x = t[p[i]] != t[p[j]];
				ll di = d(i, j);
				if (M.count(di) == false)
				{
					M[di] = x;
					at.push_back(j);
				}
				else
				{
					if (M[di] != x)
					{
						ok = false;
						break;
					}
				}
			}
			if (ok)
				ieskok(i + 1);
			for (ll j : at)
			{
				M.erase(d(i, j));
			}
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (ll i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
		p.push_back(i);
	}
	t[p[0]] = 1;
	ieskok(1);
}


/*input
6
2 5
0 3
-4 -1
-5 -4
1 0
3 -1

*/
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll n;
ll x[1010], y[1010];
ll t[1010];
vector<ll>p;
map<ll, bool>M;
ll d(ll i, ll j)
{
	i = p[i];
	j = p[j];
	ll a = x[i] - x[j];
	ll b = y[i] - y[j];
	return a * a + b * b;
}
void ieskok(ll i)
{
	if (i == n)
	{
		ll kiek = 0;
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				kiek++;
		}
		cout << kiek << "\n";
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				cout << i + 1 << " ";
		}
		cout << "\n";
		exit(0);
	}
	for (t[p[i]] = 0; t[p[i]] <= 1; t[p[i]]++)
	{
		bool ok = true;
		for (ll j = 0; j < i; j++)
		{
			bool x = p[i] != p[j];
			ll di = d(i, j);
			if (M.count(di))
			{
				if (M[di] != x)
				{
					ok = false;
					break;
				}
			}
		}
		if (ok)
		{
			vector<ll>at;
			for (ll j = 0; j < i; j++)
			{
				bool x = p[i] != p[j];
				ll di = d(i, j);
				if (M.count(di) == false)
				{
					M[di] = x;
					at.push_back(j);
				}
			}
			ieskok(i + 1);
			for (ll j : at)
			{
				bool x = p[i] != p[j];
				ll di = d(i, j);
				M.erase(di);
			}
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (ll i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
		p.push_back(i);
	}
	shuffle(p.begin(), p.end(), rng);
	t[p[0]] = 1;
	ieskok(1);
}


/*input
3
0 0
0 1
1 0

*/
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll n;
ll x[1010], y[1010];
ll t[1010];
vector<ll>p;
map<ll, bool>M;
ll d(ll i, ll j)
{
	i = p[i];
	j = p[j];
	ll a = x[i] - x[j];
	ll b = y[i] - y[j];
	return a * a + b * b;
}
void ieskok(ll i)
{
	if (i == n)
	{
		ll kiek = 0;
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				kiek++;
		}
		if (kiek == n)
			return;
		cout << kiek << "\n";
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				cout << i + 1 << " ";
		}
		cout << "\n";
		exit(0);
	}
	for (t[p[i]] = 0; t[p[i]] <= 1; t[p[i]]++)
	{
		bool ok = true;
		for (ll j = 0; j < i; j++)
		{
			bool x = t[p[i]] != t[p[j]];
			ll di = d(i, j);
			if (M.count(di))
			{
				if (M[di] != x)
				{
					ok = false;
					break;
				}
			}
		}
		if (ok)
		{
			vector<ll>at;
			for (ll j = 0; j < i; j++)
			{
				bool x = t[p[i]] != t[p[j]];
				ll di = d(i, j);
				if (M.count(di) == false)
				{
					M[di] = x;
					at.push_back(j);
				}
			}
			ieskok(i + 1);
			for (ll j : at)
			{
				ll di = d(i, j);
				M.erase(di);
			}
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (ll i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
		p.push_back(i);
	}
	shuffle(p.begin(), p.end(), rng);
	t[p[0]] = 1;
	ieskok(1);
}


/*input
3
0 0
0 1
1 0

*/
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll n;
ll x[1010], y[1010];
ll t[1010];
vector<ll>p;
map<ll, bool>M;
ll d(ll i, ll j)
{
	i = p[i];
	j = p[j];
	ll a = x[i] - x[j];
	ll b = y[i] - y[j];
	return a * a + b * b;
}
void ieskok(ll i)
{
	if (i == n)
	{
		ll kiek = 0;
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				kiek++;
		}
		if (kiek == 0 || kiek == n)
			return;
		cout << kiek << "\n";
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				cout << i + 1 << " ";
		}
		cout << "\n";
		exit(0);
	}
	for (t[p[i]] = 0; t[p[i]] <= 1; t[p[i]]++)
	{
		bool ok = true;
		for (ll j = 0; j < i; j++)
		{
			bool x = t[p[i]] != t[p[j]];
			ll di = d(i, j);
			if (M.count(di))
			{
				if (M[di] != x)
				{
					ok = false;
					break;
				}
			}
		}
		if (ok)
		{
			vector<ll>at;
			for (ll j = 0; j < i; j++)
			{
				bool x = t[p[i]] != t[p[j]];
				ll di = d(i, j);
				if (M.count(di) == false)
				{
					M[di] = x;
					at.push_back(j);
				}
				else
				{
					if (M[di] != x)
					{
						ok = false;
						break;
					}
				}
			}
			if (ok)
				ieskok(i + 1);
			for (ll j : at)
			{
				M.erase(d(i, j));
			}
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (ll i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
		p.push_back(i);
	}
	shuffle(p.begin(), p.end(), rng);
	t[p[0]] = 1;
	ieskok(1);
}


/*input
3
0 0
0 1
1 0

*/
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll n;
ll x[1010], y[1010];
ll t[1010];
vector<ll>p;
map<ll, bool>M;
ll d(ll i, ll j)
{
	i = p[i];
	j = p[j];
	ll a = x[i] - x[j];
	ll b = y[i] - y[j];
	return a * a + b * b;
}
void ieskok(ll i)
{
	if (i == n)
	{
		ll kiek = 0;
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				kiek++;
		}
		cout << kiek << "\n";
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				cout << i + 1 << " ";
		}
		cout << "\n";
		exit(0);
	}
	for (t[p[i]] = 0; t[p[i]] <= 1; t[p[i]]++)
	{
		bool ok = true;
		for (ll j = 0; j < i; j++)
		{
			bool x = t[p[i]] != t[p[j]];
			ll di = d(i, j);
			if (M.count(di))
			{
				if (M[di] != x)
				{
					ok = false;
					break;
				}
			}
		}
		if (ok)
		{
			vector<ll>at;
			for (ll j = 0; j < i; j++)
			{
				bool x = t[p[i]] != t[p[j]];
				ll di = d(i, j);
				if (M.count(di) == false)
				{
					M[di] = x;
					at.push_back(j);
				}
			}
			ieskok(i + 1);
			for (ll j : at)
			{
				ll di = d(i, j);
				M.erase(di);
			}
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (ll i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
		p.push_back(i);
	}
	shuffle(p.begin(), p.end(), rng);
	t[p[0]] = 1;
	ieskok(1);
}


/*input
3
0 0
0 1
1 0

*/
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll n;
ll x[1010], y[1010];
ll t[1010];
vector<ll>p;
map<ll, bool>M;
ll d(ll i, ll j)
{
	i = p[i];
	j = p[j];
	ll a = x[i] - x[j];
	ll b = y[i] - y[j];
	return a * a + b * b;
}
void ieskok(ll i)
{
	if (i == n)
	{
		ll kiek = 0;
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				kiek++;
		}
		if (kiek == 0 || kiek == n)
			return;
		cout << kiek << "\n";
		for (ll i = 0; i < n; i++)
		{
			if (t[i] == 0)
				cout << i + 1 << " ";
		}
		cout << "\n";
		exit(0);
	}
	for (t[p[i]] = 0; t[p[i]] <= 1; t[p[i]]++)
	{
		bool ok = true;
		for (ll j = 0; j < i; j++)
		{
			bool x = t[p[i]] != t[p[j]];
			ll di = d(i, j);
			if (M.count(di))
			{
				if (M[di] != x)
				{
					ok = false;
					break;
				}
			}
		}
		if (ok)
		{
			vector<ll>at;
			for (ll j = 0; j < i; j++)
			{
				bool x = t[p[i]] != t[p[j]];
				ll di = d(i, j);
				if (M.count(di) == false)
				{
					M[di] = x;
					at.push_back(j);
				}
			}
			ieskok(i + 1);
			for (ll j : at)
			{
				M.erase(d(i, j));
			}
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (ll i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
		p.push_back(i);
	}
	shuffle(p.begin(), p.end(), rng);
	t[p[0]] = 1;
	ieskok(1);
}